SELECT

The SELECT statement is one of the most complicated SQL statements. It’s so complicated that only its most useful variations are described here.

The SELECT statement lets you select data and return it to your application, insert it in another table, use it to create a temporary table, or use it in another query.

The basic syntax for a SELECT statement is

SELECT [DISTINCT] [TOP number [PERCENT]] fields 
[INTO table] 
FROM tables 
[WHERE where_conditions] 
[GROUP BY group_by_expression] 
[HAVING search_conditions[ 
[ORDER BY order_fields [ASC | DESC]] 

The following sections describe the different SELECT statement clauses.

SELECT

The fields parameter indicates the fields that should be selected by the statement. If the fields are all taken ...

Get Visual Basic® .NET Database Programming 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.