Summary of Lesson 7 - Using SQL in SAS
Summary of Lesson 7 - Using SQL in SAS
The SELECT statement describes the query. List columns to include in the results after SELECT,
separated by commas.
The ORDER BY clause arranges rows based on the columns listed. The default order is
ascending. Use DESC after a column name to reverse the sort sequence.
PROC SQL;
SELECT col-name, col-name
FROM input-table;
QUIT;
Subsetting data:
WHERE expression
Sorting data:
Deleting data:
ON table1.column = table2.column
Assign an alias (or nickname) to a table in the FROM clause by adding the keyword AS and the
alias of your choice. Then you can use the alias in place of the full table name to qualify columns
https://vle.sas.com/pluginfile.php/800800/mod_scorm/content/274/07/summary07.htm 1/2
7/18/2021 Summary of Lesson 7: Using SQL in SAS
Copyright © 2021 SAS Institute Inc., Cary, NC, USA. All rights reserved.
https://vle.sas.com/pluginfile.php/800800/mod_scorm/content/274/07/summary07.htm 2/2