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

Summary

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 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.