Retrieving Data with SELECT

The SELECT statement is used to retrieve and filter data from your data source. Listing 3.1 shows the simplified syntax of the SELECT statement. Read from top to bottom, this statement says “select these columns from these tables where these search criteria are true.” You can retrieve several column names from several tables, so long as you separate the column names by commas.

Listing 3.1. The Syntax of the SELECT SQL Statement

For instance, to retrieve all records from the Employees table, enter the following code in the query manager and press F5 or click the green Play button to execute the query:

SELECT * FROM Employees

This will return every single ...

Get Sams Teach Yourself ADO.NET in 24 Hours now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.