proc sql;
select *
from certadv.col1 intersect
select *
from certadv.col2;
quit;
proc sql;
select *
from certadv.col1 intersect all
select *
from certadv.col2;
quit;
proc sql;
select *
from certadv.col1 intersect corr
select *
from certadv.col2;
quit;
proc sql;
select *
from certadv.col1 intersect all corr
select *
from certadv.col2;
quit;
1
, and only one row
is displayed in the output.
However, in order to be considered a common row and to be included
in the output, every duplicate row in one table must have a separate
duplicate row in the other table. In this example, there are no rows
that have duplicate values and that are also common across tables.
Therefore, in this example, the set operation with the keywords ALL
and CORR generates the same output as with the keyword CORR alone.
Table
|
Relevant Columns
|
---|---|
Certadv.Staffchanges
lists information for all new employees and existing employees who
have had a change in salary or job code.
|
FirstName,
LastName |
Certadv.Staffmaster
lists information for all existing employees.
|
FirstName,
LastName |
proc sql;
select firstname, lastname
from certadv.staffchanges
intersect all
select firstname, lastname
from certadv.staffmaster;
quit;