Tests if a subquery returns one or more rows.
See: | Query Expressions (Subqueries) |
is described in query-expression.
CT
in
PROCLIB.STAFF (which is shown in Joining Two Tables), then the matching IDNUM in PROCLIB.PAYROLL is included
in the output. Thus, the query returns all the employees from PROCLIB.PAYROLL
who live in CT
. proc sql; select * from proclib.payroll p where exists (select * from proclib.staff s where p.idnumber=s.idnum and state='CT');