CHAPTER 1

image

Getting Started with SELECT

by Jonathan Gennick

The SELECT command is the cornerstone of the Transact-SQL language, allowing you to retrieve data from a SQL Server database (and more specifically from database objects within a SQL Server database). Although the full syntax of the SELECT statement is enormous, the basic syntax can be presented in a more boiled-down form:

SELECT select_listFROM table_listWHERE predicatesORDER BY sort_key_columns;

The select_list argument is the list of columns that you wish to return in the results of the query. The table_list arguments are the actual tables and/or views from which the data will be retrieved. ...

Get SQL Server 2012 T-SQL Recipes: A Problem-Solution Approach now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.