MySQL IF() Function Datetime Example
Open your MySQL Query Editor then copy & paste the below code to get the value of IF() MySQL Function Datetime Example:
SELECT now(), now()-1, now()+10, now()-10, IF(now() > now()-1, now()+10, now()-10) AS Results; -- SELECT now(), now()-1, now()+10, now()-10, IF(now() < now()-1, now()+10, now()-10) AS Results; -- SELECT now(), now()-1, now()+10, now()-10, IF(now() != now()-1, now()+10, now()-10) AS Results; -- SELECT now(), now()+10, now()-10, IF(NULL, now()+10, now()-10) AS Results; -- MySQL IF() Function Compares Three Expressions -- -- if [Expression1/Value1] evaluates to true, returns [Expression2/Value2] -- else [Expression3/Value3]
-- is comment in MySQL
-- in fact it is comment in MSSQL and Oracle as well
MySQL IF() Function Datetime Example - Result in MySQL Query Editor
Related Tutorial Examples
- MySQL IF() Function Boolean Value Example
- MySQL IF() Nested Function Example
- MySQL IF() Function NULL Value Example
- MySQL IF() Function String Value Example
- MySQL IF() Function Number Value Example
- MySQL IFNULL() Function NULL Value Example
- MSSQL PRINT Like Function in MySQL Example
- How to Find MySQL Stored Procedure or Function Information
- Describe Table Structure using SQL Command MySQL Example
- SELECT specific columns using SQL Command MySQL Example

No comments:
Post a Comment
leave your comments here..