[thelist] SQL In need of Optimization....

Mark Groen mgvanca at home.com
Fri Jun 29 09:37:48 CDT 2001


[sheesh] but we get the best SQL answers from you rudy - keep it up and
thanks - long weekend for us in Canada, see you all next week!

<snip>
replying to my own post again [sheesh]

>   select obladi, oblada
>     from tblCollegeSearch
>   where CollegeID in
>      ( select CollegeID , count(*)
>           from tblCollegeMajors
>         where MajorID in ( #majorList# )
>         group by CollegeID
>           having count(*) >= #X# )

the subquery should return only the CollegeID -- fundamental syntax error
to have more than one column if the subquery is used for an IN test

anthony, if you ask me now to generate the hit count (how many majors does
each college offer from among the ones that were checked off), that's a lot
harder and it's too nice a day for heavy sql...
</snip>






More information about the thelist mailing list