IF()
This page is part of MariaDB's Documentation.
The parent of this page is: Functions for MariaDB Enterprise Server
Topics on this page:
Overview
Return a value based on a truth expression.
EXAMPLES
SELECT IF(10>20,'YES','no') AS result;
+--------+
| result |
+--------+
| no |
+--------+
SELECT IF((STRCMP('yeah','yes')=STRCMP('nay','no')),'yes','no') AS result;
+--------+
| result |
+--------+
| yes |
+--------+
CHANGE HISTORY
EXTERNAL REFERENCES
Additional information on this topic may be found in the MariaDB Public Knowledge Base.