SORTED.SAMPLE

SORTED.SAMPLE

Top  Previous  Next

 

The SORTED.SAMPLE selection clause keyword causes only a limited number of records to be selected or displayed. The synonym SORTED.FIRST can be used in place of SORTED.SAMPLE.

 

 

Format

 

SORTED.SAMPLE {n}

 

where

 

nis the number of records to be processed. If n is omitted, this defaults to 10.

 

 

The SORTED.SAMPLE keyword causes selection or listing of records to terminate after the given number of records have been found.

 

The record count restriction is applied after sorting. Thus it can be used to show, for example, only the first three records in sorted order of the whole file.

 

 

The keyword is ignored if the query does not include a sort clause.

 

 

Example

 

LIST STOCK BY PRICE SORTED.SAMPLE 5

 

This command lists the first 5 lowest priced items found on the STOCK file.

 

 

See also:

SAMPLE