Chapter 9. SELECT Statement: SELECT Clause and Aggregation Functions

9.1 Introduction

The WHERE clause, described in the previous chapter, is used to select rows. The intermediate result from this clause forms a horizontal subset of a table. In contrast, the SELECT clause selects only columns, not rows; the result forms a vertical subset of a table.

The features, limitations, and use of the SELECT clause depend on the presence or absence of a GROUP BY clause. This chapter discusses table expressions without a GROUP BY clause. Chapter 10, “SELECT Statement: The GROUP BY Clause,” discusses the features of the SELECT clause when the table expression does contain a GROUP BY clause.

A large part of this chapter is devoted to so-called aggregation ...

Get SQL for MySQL Developers: A Comprehensive Tutorial and Reference 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.