The SELECT statement is perhaps the most frequently used SQL command. It retrieves records (or specified fields from records) from one or more tables in the database. In this section, we will cover some simple SELECT statements, which take the following general form:
SELECT fieldlist FROM tablename [WHERE where clause]
In this chapter, statement formats are listed with the SQL keywords in all capital letters. The italicized words indicate terms that a programmer would replace in an actual statement, and phrases inside square brackets ([ ]) are optional parts of the statement.
The simplest, most common example of a SELECT statement is selecting all fields from a single table. To display all of the data in the ...