Message
General information
Fórum:
Visual FoxPro
Category:
Bases de dados, Tabelas, Views, Indices e SQL
Miscellaneous
ID da thread:
00359337
ID da mensagem:
00359421
Views:
14
Results of some experiments:

I created a table "difference" containing only the IDs of the students who were not being included.

For the following code:


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
Previous
Responder
Mapa
View