Supporting T-SQL language elements in a Synapse SQL pool
The SELECT statement in T-SQL retrieves rows from a database and enables the selection of columns and rows from one or multiple tables in Azure Synapse SQL. You can use the SELECT statement with WHERE, GROUP BY, HAVING, and ORDER BY clauses in dedicated and serverless SQL pools. The syntax for the SELECT statement in Synapse SQL is similar to that found in Azure SQL Database or SQL Server.
The following code snippet provides an example of using a SELECT statement:
SELECT OrderDateKey, SUM(SalesAmount) AS TotalSales FROM FactInternetSales GROUP BY OrderDateKey HAVING OrderDateKey > 20010000 ORDER BY OrderDateKey;
We can also create Common Table Expressions (CTEs) in Synapse SQL pools. We will learn about these in the following section.
CTEs
A CTE is a temporary result set that is used to simplify complex joins and subqueries. CTEs can also be used to query hierarchical...