EXAMPLE - EXCLUDES EXPRESSION

EXAMPLE - EXCLUDES EXPRESSION

You could use the CASE function in a SQL statement where the expression is omitted.
SELECT
CASE
  WHEN a < b THEN 1
  WHEN supplier_type = 'clothing' THEN 2
  ELSE 3
END
FROM suppliers;
In this CASE function example, an expression has not been included so each condition is individually evaluated and can be completely different and unique. When a condition is met, the corresponding value would be returned.
Read more: MYSQL: CASE FUNCTION

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Продовжуйте вивчати
сніпети з SQL
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести