Select List Examples

The select list can include * (all columns in the order in which the table was created), a list of column names in any order, character strings, column headings, and expressions, including arithmetic operators. Here are some sample select lists:

A.    SELECT titles.*
    FROM titles

B.    SELECT Name = au_fname, Surname = au_lname
    FROM authors

C.    SELECT Sales = ytd_sales, ToAuthor = (ytd_sales * royalty) / 100,
    ToPublisher = ytd_sales - (ytd_sales * royalty) / 100
    FROM titles

D.    SELECT 'Social security #', au_id
    FROM authors

E.    SELECT this_year = advance,
    next_year = advance  advance / 10,
    third_year = advance / 2, 'for book title #', title_id
    FROM titles

F.    SELECT 'Total income is', Revenue = price * ytd_sales,
    'for', Book# = title_id
    FROM titles

The select list can also include aggregate functions, which are discussed in Using Summary Queries and in Displaying Totals with GROUP BY or COMPUTE.