Using the SQL SELECT Statement

As we have already seen, the SQL SELECT statement is used to retrieve the values of a particular database table's columns via the following syntax:

SELECT Column1, Column2, ..., ColumnN
FROM TableName
					

where Column1 ... ColumnN are columns from the database table TableName. For example, to retrieve the values from the Name and Phone columns from the Customers table, the following SQL statement would be used:

SELECT Name, Phone
FROM Customers

Note that this SELECT statement contains two clauses: the SELECT clause and the FROM clause. Clauses are keywords in the SQL SELECT statement that precede the data they operate on. The two required clauses in a SELECT statement are the SELECT and FROM clauses. As you have ...

Get SAMS Teach Yourself ASP.NET in 24 Hours 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.