Your Library
Chapter 7 · CASE ExpressionsConditional values, NULLs, and conditional aggregation
Contents
Chapter 6

CASE Expressions

Conditional values, NULLs, and conditional aggregation

Use CASE to choose a value from conditions in a query. This chapter builds from searched and simple forms to NULL-aware classification, calculations, and conditional aggregation. The examples target MySQL and PostgreSQL unless a dialect is explicitly named.

In this chapter

  1. 6.1CASE Expressions and Conditional Logic