Microsoft Data Technology · Microsoft SSDB · Transact SQL

TSQL – Part 1(b) – SELECT statement

  • Use the SELECT statement to retrieve a rowset of data from tables and views in a database.
  • SELECT statements are written with the following clauses: SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY. However, the query engine processes the clauses in this order: FROM, WHERE, GROUP BY, HAVING, SELECT, ORDER BY.
  • In the SELECT clause, you can use * to return all columns, but generally, you should specify explicit columns.
  • You can specify expressions in the SELECT clause to return the results of calculations.
  • You can use the AS keyword to specify aliases for columns in the rowset returned by the SELECT statement.

Additional Reading

Review the documentation for SELECT in the Transact-SQL Reference.

Note: Microsoft is the owner of the content and video in this blog post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s