Sub-SELECT
Top  Previous  Next

This clause works in conjunction with the WHERE clause to determine which rows of data to include.

subselec

Options

For a description of the options, see the "SELECT" entry.

About the Sub-SELECT Clause

A sub-SELECT command, which is a SELECT command nested within another command, always appears in a WHERE clause, whether the sub-SELECT command is nested in the WHERE clause of a SELECT command or in another command such as EDIT USING form. R:BASE processes the clauses in a sub-SELECT in the same order as in a SELECT command.

Example

The following example selects customers that have purchased items in the month of January.

SELECT company FROM customer WHERE custid +
   IN (SELECT custid FROM transmaster +
   WHERE (IMON(transdate)=1))

company
   
PC Distribution Inc.   
Computer Distributors Inc.   
Industrial Concepts Inc.   
PC Consultation and Design