Using the SELECT Statement

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] 

Note

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 ...

Get Special Edition Using Microsoft® Visual Basic® .NET 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.