Retrieves data from tables.
| See: | table-expression |
| Query Expressions (Subqueries) | |
| In-Line Views |
is described in table-expression.
is one of the following:
data me1; input IDnum $ Jobcode $ Salary Bonus; datalines; 1400 ME1 29769 587 1403 ME1 28072 342 1120 ME1 28619 986 1120 ME1 28619 986 ; data me2; input IDnum $ Jobcode $ Salary; datalines; 1653 ME2 35108 1782 ME2 35345 1244 ME2 36925 ;
proc sql;
title 'ME1 and ME2: OUTER UNION CORRESPONDING';
select *
from me1
outer union corr
select *
from me2;proc sql;
title 'ME1 and ME2: UNION';
select *
from me1
union
select *
from me2;proc sql;
title 'ME1 and ME2: UNION ALL';
select *
from me1
union all
select *
from me2;data in_usa; input Flight $ Dest $; datalines; 145 ORD 156 WAS 188 LAX 193 FRA 207 LON ; data OUT_USA; input Flight $ Dest $; datalines; 193 FRA 207 LON 311 SJA ;
proc sql;
title 'Flights from Both IN_USA and OUT_USA';
select * from in_usa
intersect
select * from out_usa;