SELECT in T-SQL

SELECT in T-SQL: SELECT in T-SQL: an overview, SELECT Query Structure, Simple SELECT Query, Specifying Columns, Calculations in Columns, TOP and ORDER BY.

Updated

  1. SELECT in T-SQL: an overview (Novice): A SELECT statement asks the database a question and gets back a table of answers; T-SQL is SQL Server's version of SQL.
  2. SELECT Query Structure (Novice): A SELECT statement is built from clauses that always appear in the same order; this chapter uses SELECT, FROM, WHERE and ORDER BY.
  3. Simple SELECT Query (Novice): SELECT * FROM a table returns every column and every row, the quickest way to see what a table holds.
  4. Specifying Columns (Novice): List the columns you want, in the order you want them, and rename them in the result with AS.
  5. Calculations in Columns (Apprentice): Work out new values as you query, with arithmetic on a row's columns and joined text, and give each calculated column a name.
  6. TOP and ORDER BY (Novice): Sort a query's results with ORDER BY, ascending or descending, by one column or several, and keep only the first rows with TOP.