Date: Mon, 15 Jul 1996 23:24:20 GMT
Reply-To: Frank Liu <fliu@WORLD.STD.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Frank Liu <fliu@WORLD.STD.COM>
Organization: The World Public Access UNIX, Brookline, MA
Subject: Re: SQL Qn.
Very interesting.
Please try the following SQL code:
proc sql;
select SCODE,
VNAME
from DATASET
group by VNAME
having count(*) = ( select count(distinct SCODE) as S
from DATASET );
quit;
Good luck.
Frank Liu
Genzyme Inc.,
One kendall square
Cambradge, MA 02139
-----------------------------------------------------------------------
Prasad Ravi USAET(UTC -04:00) (prasad_ravi@E-MAIL.COM) wrote:
: How do I pick the VNAMEs which exist in each SCODE of the following dataset
: using SQL only?.
: SCODE VNAME
: 140 AGE
: 140 SEX
: 250 RACE
: 250 SEX
: 250 HEIGHT
: 400 AGE
: 400 RACE
: 400 WEIGHT
: 400 SEX
: Regards,
: Prasad Ravi 300 Renaissance Center
: Marketing, Finance & Staff Systems POB 43315, Rm 3198A
: Ford Motor Company,Detroit,MI 48243. Ph 1-313-44-64402(Fax5900)
|