select students.student_id, ;
hs.hs_name, ;
hcontact.sport,; && coach's sport specialty
hcontact.fname, ; && coach name
hcontact.lname, ;
from difference;
inner join students;
on difference.student_id =students.student_id;
inner join hs;
on students.ceeb = hs.ceeb;
left outer join hcontact;
on hs.ceeb = hcontact.ceeb
/
the results include the first coach from any sport where there is a sport (GBK, FB), and .NULL. if the school has no coaches entered. All students are listed.
If I modify the code by adding a coach sport filter at the end:
select students.student_id, ;
hs.hs_name, ;
hcontact.sport,;
hcontact.fname, ;
hcontact.lname, ;
from difference;
inner join students;
on difference.student_id =students.student_id;
inner join hs;
on students.ceeb = hs.ceeb;
left outer join hcontact;
on hs.ceeb = hcontact.ceeb;
where hcontact.sport = 'GVB'
/
The result set is empty. So your comment about the WHERE/HAVING clause is correct. Now, how to get around it?
Neil