Case
Basic usage
- Always end your CASE expression with .end()
- Always give your CASE expression an alias with .as()
- The .else() clause is optional but recommended to handle NULL cases
- Use eb.fn for SQL functions like COUNT, SUM, etc.
- You can use CASE expressions in SELECT, WHERE, ORDER BY, and GROUP BY clauses