SELECT (SQL Statement)

Description

Retrieves rows from the database and allows the selection of one or many rows or columns from one or many tables.

 

Syntax

SELECT [ DISTINCT ] [ TOP n [ PERCENT ]] select_list
FROM table_source
[ WHERE search_condition ]
[ GROUP BY group_by_expression ]
[ HAVING search_condition ]
[ ORDER BY order_expression [ ASC | DESC ] ]

 

Example

SELECT *
FROM table1
INNER JOIN table2 ON table1.c1 = table2.c1
WHERE table1.c1 > 10
ORDER BY table1.c1