Choosing Specific Columns

To select specific columns in a table, explicitly list each column in the select list. For example, to list only the first names of people in the Persons.Person table and their telephone numbers, use:

SELECT p.FirstName, pp.PhoneNumber
FROM AdventureWorks2008R2.Person.Person AS p
JOIN AdventureWorks2008R2.Person.PersonPhone AS pp
     ON p.BusinessEntityID = pp.BusinessEntityID
ORDER BY FirstName ASC;

Specifying the columns in the select list can also include specifying an alias (for example, proj_sales AS "Projected Sales") or other expressions, such as (price = price * 1.15, or SUM(SalesAmount).

See Also

Reference