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

Joshua Olson joshua at alphashop.net
Fri Jun 29 09:05:52 CDT 2001


: Alastair has my vote:
:
: SELECT ColumnOne, ColumnTwo, ColumnThree FROM tblCollegesSearch
: JOIN tblCollegeMajors
:    ON (tblCollegeMajors.CollegeID = tblCollegesSearch.CollegeID)
: WHERE  tblCollegesSearch.CollegeID IN
:       ('1','2','3')
: GROUP BY RegionID, AcceptanceRateCategory order by 1,2 desc
:
: HTH
: - IanO -
: Ian Ornstein - Programmer and Web Developer
: IBM Global Services, Global AMS Delivery
: (704) 509-8022

It seems to me that the problem with this approach is that it will return
records for any college that match any one of the majors (I'm assuming the
WHERE clause is mistyped to have CollegeID instead of MajorID :) without
giving any feedback on whether a single college offers 1, 2, or all three of
the majors.  For a person double or triple majoring this search criterion
would be a benefit.

-joshua





More information about the thelist mailing list