Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

mysql switch case

SELECT CASE lower(col1)
	WHEN 'agree' THEN 'Ok'
	WHEN 'disagree' THEN 'Ko'
    ELSE
        CASE 
            WHEN col2 = 1 THEN 'Ko'
            ELSE 'Maybe'
        END
END AS my_result
FROM table_name;
 
PREVIOUS NEXT
Tagged: #mysql #switch #case
ADD COMMENT
Topic
Name
1+3 =