SELECT clause
projection: computes expressions, assigns aliases, expands *
What changes
- Input
- columns and expressions from the FROM result after WHERE/GROUP BY/HAVING
- Output or change
- projected columns (result or INTO table or variables)
Syntax at a glance
SELECT [ ALL | DISTINCT ] [ TOP ( expression ) [ PERCENT ] [ WITH TIES ] ] <select_list>
Work example
A query needs a deliberate output list with expressions and stable column names.
Name the required columns instead of using star in shared code. Check aliases and data types in the result grid.
Check your work SELECT clause. The output contains only the requested columns in the stated order.
Open Microsoft Learn for full syntax, permissions, and details for your version.