O'Reilly logo

Joe Celko's SQL for Smarties, 5th Edition by Joe Celko

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 20

CASE Expression Family

Abstract

SQL is declarative, so we do not have the concept of flow control in procedural languages. Instead, we use expressions that come from primitive recursive function theory to select a result from among possible values.

Keywords

CASE expression

CASE expressions with GROUP BY

CHECK() clauses

COALESCE()

ELSE

Material implication

NULLIF()

Smisteru transform

THEN

WHEN

SQL-92 added new expressions and extended the rules for old ones to make the language more orthogonal. Basically, anything that looks reasonable is probably legal syntax. But SQL is declarative, so we do not have the concept of flow control in procedural languages. Instead, we use expressions that come from primitive recursive function theory ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required