Daily Learning · 2022-12-04 · SQL
SQL
SQL - when using a CASE() function combined with an aggregator, the aggregator must come first.
- i.e., Sum(Case When
When using SUM and CASE, the value you want to sum comes after the THEN statement.
- you don’t always need to use a cte