@kksss wrote:
1) who only belongs to a certain college, no matter how many majors they have,
proc sql ;
select *
from have
where student_id in (
select student_id from have where student_id in(
select student_id from have group by student_id having count(distinct college) =1)
and college ='Science');
quit;
@kksss wrote:
2) who has major in one certain college, e.g. science, but also has a major outside that college.
proc sql ;
select *
from have
where student_id in
(select distinct student_id
from have
where student_id in
(select distinct student_id from have where College='Social Science')
and College ~= 'Social Science' );
quit;
... View more