The mighty Transact-SQL SELECT
You probably already know that the most important SQL statement is the mighty SELECT statement you use to retrieve data from your databases. Every database developer knows the basic clauses and their usage:
SELECT
to define the columns returned, or a projection of all table columnsFROM
to list the tables used in the query and how they are associated, or joinedWHERE
to filter the data to return only the rows that satisfy the condition in the predicateGROUP BY
to define the groups over which the data is aggregatedHAVING
to filter the data after the grouping with conditions that refer to aggregationsORDER BY
to sort the rows returned to the client application
Besides these basic clauses, SELECT
offers a variety of advanced possibilities as well. These advanced techniques are unfortunately less exploited by developers, although they are really powerful and efficient. Therefore, I advise you to review them and potentially use them in your applications. The advanced...