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
Войдите чтобы поставить Нравится
Войдите чтобы прокомментировать