19. Condition Testing

“The only real mistake is the one from which we learn nothing.”

—John Powell

Topics Covered in This Chapter

Conditional Expressions (CASE)

Solving Problems with CASE

Sample Statements


Problems for You to Solve

You might remember that way back in Chapter 4, “Creating a Simple Query,” we explained the difference between data and information. You store data in the rows and columns in your tables, but you often need a query to turn that data into useful information. Sometimes, turning data into information requires you to perform complex calculations or transformations of your data to get what you want. It could be something as simple as formatting a salutation for the name line of address labels. Or, you might need ...

Get SQL Queries for Mere Mortals®: A Hands-On Guide to Data Manipulation in SQL, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.