CASE WHEN with calculation : CASE WHEN Select « Flow Control « SQL / MySQL






CASE WHEN with calculation



SELECT CASE 10*2
   WHEN 20 THEN '20 correct'
   WHEN 30 THEN '30 correct'
   WHEN 40 THEN '40 correct'
END;



           
       








Related examples in the same category

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