Edit

SELECT (Transact-SQL)

Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics SQL analytics endpoint in Microsoft Fabric Warehouse in Microsoft Fabric SQL database in Microsoft Fabric

Use the SELECT statement to retrieve rows from the database. SELECT lets you choose one or many rows or columns from one or many tables in the SQL Server Database Engine.

Because the full syntax SELECT statement is complex, detailed syntax elements and arguments are shown per clause. Refer to the Syntax section for how these clauses work together.

The UNION, EXCEPT, and INTERSECT operators can be used between queries to combine or compare their results into one result set.

Transact-SQL syntax conventions

Syntax

Syntax for SQL Server and Azure SQL Database: