Thursday, 22 December 2011

MySQL CASE OPERATOR Tutorial

MySQL CASE Operator is used for  flow control. It is useful to create a complex conditional construct.

The Synatx is as follows :

CASE case_value
WHEN when_value THEN statement_list
[WHEN when_value THEN statement_list] ...
[ELSE statement_list]
END CASE

An example of MySQL CASE Operator is :


Refernce : MySQL CASE OPERATOR of w3resource MySQL Tutorial.