Simple CASE WHEN command : CASE WHEN Select « Flow Control « SQL / MySQL






Simple CASE WHEN command



SELECT CASE WHEN 10*2=30 THEN '30 correct'
   WHEN 10*2=40 THEN '40 correct'
   ELSE 'Should be 10*2=20'
END;



           
       








Related examples in the same category

1.Use CASE WHEN for string value
2.Use case when
3.CASE WHEN with calculation
4.Use CASE WHEN statement in SELECT
5.Use CASE WHEN statement in SELECT 2