条件分岐caseSELECT CASE 1 WHEN 1 THEN "one" WHEN 2 THEN "two" ELSE "more" END; ifSELECT IF(2>1, 'YES', 'NO'); --'YES' UPDATE users SET class = IF(age >= 20, 'adult', 'child'); 参考 |
|
条件分岐caseSELECT CASE 1 WHEN 1 THEN "one" WHEN 2 THEN "two" ELSE "more" END; ifSELECT IF(2>1, 'YES', 'NO'); --'YES' UPDATE users SET class = IF(age >= 20, 'adult', 'child'); 参考 |
|