MySQL have several Control Flow Functions listed as below:
Control function returns value based on each row processed by the query executed. Control functions can be used on SELECT, WHERE, ORDER BY and GROUP BY statements.
We can say this is just like the switch case in programming languages.
This function takes the three parameters as expression, if expression one is true the it will return second parameter otherwise it will return third parameter.
This function takes two parameters as a expression. And if expression one is not num then it will return expression one otherwise it will return expression two.
This function takes two parameter as a expression. It will return NULL if expr1=expr2 will return TRUE otherwise it will return expr1.
Note: MySQL evaluates expr1 twice if the arguments are not equal.
Avinash Zala is leading various projects which deals with the various technology involved with the web. A combination of perfect technical and management skills. Avinash would like to chat with you and convert your imagination into the working system. You can get in touch with him on Facebook and Twitter.
View all posts by: Avinash