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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.