SELECT

SELECT is used to retrieve data from one or more tables (or views). See Lesson 2, “Retrieving Data;” Lesson 3, “Sorting Retrieved Data;” and Lesson 4, “Filtering Data,” for more basic information. (Lessons 214 all cover aspects of SELECT.)

SELECT columnname, ...
FROM tablename, ...
[WHERE ...]
[GROUP BY ...]
[HAVING ...]
[ORDER BY ...];

Get Sams Teach Yourself SQL in 10 Minutes, Second 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.