SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Performing Queries Using SQL
Additional Features


You can use several other clauses within the SELECT statement to further refine your query.
  • You can use the GROUP BY clause to group observations and apply a summary function to the group.

  • When you use a GROUP BY clause, you can also use a HAVING clause to specify the condition(s) that each group must satisfy in order to be included in the query output.

     proc sql;
        select custname as name, count(*)
           from sql.customer
           group by name
           having count(*)=1;

back||next

 

Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement