Date: Fri, 29 Jul 2011 13:01:14 -0400
Reply-To: Fangfang Sun <sunffang@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Fangfang Sun <sunffang@YAHOO.COM>
Subject: proc sql?
data a;
input rep$ cost;
cards;
smith 200
smith 400
jones 100
smith 600
jones 100
;
proc sql;
select rep, avg(cost) as average from a
group by rep
having average>(select avg(cost) from a);
quit;
why the output is
rep average
smith 400
?
Thanks!
|