CASE and CAST Functions

ANSI SQL provides a function named CASE that can be used to create IF/THEN flow-control logic within queries or UPDATE statements. The CAST function is for converting between datatypes and is also in the ANSI standard. All of the databases covered in this book provide ANSI standard support for both the CASE and CAST functions.

Get SQL in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.