MySQL IF() Function String Example
Open your MySQL Query Editor then copy & paste the below code to get the value of IF() MySQL Function String Example:
SELECT IF('String1' > 'String2', 'Expression2', 'Expression3') ;
--
SELECT IF('String1' < 'String2', 'Expression2', 'Expression3') ;
--
SELECT IF('String1' != 'String2', 'Expression2', 'Expression3') ;
--
SELECT IF(NULL, 'Expression2', 'Expression3') ;
-- 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 String 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 Datetime Value Example
- MySQL IF() Function Number Value Example
- MySQL IFNULL() Function NULL Value Example
- How To Find MySQL SERVER VERSION Information
- MySQL Stored Procedure: INSERT INTO SELECT... Example
- SELECT distinct... SQL Command MySQL Example
- SELECT specific row(s) of a Table using SQL Command MySQL Example

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