The SELECT Statement

The SELECT statement is at the heart of the SQL language. You use the SELECT statement to retrieve data from one or more tables. Its basic syntax is:

SELECT column-list FROM table-list WHERE where-clause ORDER BY order-by-clause
					

The SELECT Clause

The SELECT clause specifies what columns you want to retrieve from the table that SQL Server returns to the recordset. The basic syntax for a SELECT clause is:

SELECT column-list
						

The simplest SELECT clause looks like this:

SELECT *
						

This SELECT clause retrieves all columns from a table. Here's another example that retrieves only the CustomerID and CompanyName columns from a table:

SELECT CustomerID, CompanyName
						

Not only can you include columns that exist in your table, but ...

Get Alison Balter's Mastering Access 2002 Enterprise Development 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.