Progress
SQL-89
Guide and Reference


SELECT Statement Syntax

The basic SELECT statement retrieves and displays as many rows of data as satisfy the selection criteria you specify. The basic SELECT statement is equivalent to the combination of the FOR EACH and DISPLAY statements in Progress.

The SELECT statement has the following syntax.

SYNTAX
SELECT
  [ ALL | DISTINCT ]
  { * | column-list }
  [ INTO variable-list ]
  FROM {   table-name [ correlation-name ]
         | implicit-join
         | explicit-join
       }
  [ WHERE search-condition ]
  [ GROUP BY column [ , column ] ... ]
  [ HAVING search-condition ]
  [ ORDER BY sort-criteria ]
  [ WITH [ frame-options ] [ STREAM stream ] [ EXPORT ] ] 

To specify the columns to retrieve, you can either use an asterisk (*) to indicate all columns, or you can enter a column-list, which is one or more column names and aggregate functions separated by commas. (For information on aggregate functions, see the "Using Aggregate Functions" section.) The keyword ALL, the default, selects all of the values in the specified columns. The optional keyword DISTINCT retrieves only rows with unique values.

NOTES

The following example selects all values for all columns in the customer table and displays them in a readable format.

SELECT * FROM Customer WITH 2 COLUMNS. 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095