Using readtext  Eliminating duplicate query results with distinct

Chapter 2: Queries: Selecting Data from a Table

Select list summary

The select list can include * (all columns in create table order), a list of column names in any order, character strings, column headings, and expressions including arithmetic operators. You can also include aggregate functions, which are discussed in Chapter 3, “Using Aggregates, Grouping, and Sorting.” Here are some select lists to try with the tables in the pubs2 sample database:

select titles.* 
from titles
select Name = au_fname, Surname = au_lname
from authors
select Sales = total_sales * price,
ToAuthor = advance,
ToPublisher = (total_sales * price) - advance
from titles 
select "Social security #", au_id 
from authors 
select this_year = advance, next_year = advance
   + advance/10, third_year = advance/2, 
    "for book title #", title_id 
from titles 
select "Total income is", 
Revenue = price * total_sales, 
"for", Book# = title_id 
from titles 




Copyright © 2005. Sybase Inc. All rights reserved. Eliminating duplicate query results with distinct

View this book as PDF