Thinking Conditionally

Have you ever wished for a SQL IF? Although that doesn't exist, except as a vendor extension, SQL does support a number of conditional functions. Their names vary from system to system, but what they have in common is the ability to test an expression and take action, based on the result. In this section, you'll examine CASE/DECODE and functions that deal with null values.

Get Practical SQL Handbook, The: Using SQL Variants, Fourth 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.