General form, basic
PROC SQL step for creating a table from a query result:
PROC SQL;
CREATE
TABLE table-name AS
SELECT column-1<,...column-n>
FROM table-1|view-1<,...table-n|view-n>
<WHERE expression>
<GROUP
BY column-1<,...
column-n>>
<ORDER
BY column-1<,...
column-n>>;
table-name
specifies the name
of the table to be created.
|
proc sql;
create table work.miles as
select membertype,
sum(milestraveled) as TotalMiles
from sasuser.frequentflyers
group by membertype;