© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
M. SimonLeveling Up with SQLhttps://doi.org/10.1007/978-1-4842-9685-1_7

7. Working with Subqueries and Common Table Expressions

Mark Simon1  
(1)
Ivanhoe VIC, VIC, Australia
 

Running a SELECT statement, assuming that there’s no error, gives you a result. That result is a virtual table, and it will have rows and columns.

For our purposes, we are interested in three possible virtual tables:
  • One row and one column: You get just one value, though technically it’s still in a table. We’ll call this a single value.

  • One column and multiple rows: When the time comes, we’ll call this a list.

  • Multiple rows and multiple columns: In this context, a single row with multiple ...

Get Leveling Up with SQL: Advanced Techniques for Transforming Data into Insights 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.