ok...my grasp of boolean logic is a bit rusty, but i was under the impression that the order of a series of AND statements would have no affect at all on the number of records returned. and yet, in my database, these two NEARLY IDENTICAL queries return a different number of records:
this one returns 52, the correct amount i think:
SELECT DISTINCT t1.id, t1.name, u.name
FROM myplan_majors_category t1,
myplan_majors_uber u,
myplan_majors_categories_assoc t2,
myplan_majors t3,
myplan_school_majors_assoc t4
WHERE t1.id = t2.category_id
AND t2.cip=t3.cip
AND t2.type='cert'
AND t3.cip=t4.cipcode
AND t4.certificate_number > 0
AND t1.uber_id=u.id
ORDER BY t1.display_order
WHEREAS this one (i switched the 2 'and' lines immediately after the where statement) returns 112 records.
SELECT DISTINCT t1.id, t1.name, u.name as uber_name
FROM myplan_majors_category t1,
myplan_majors_uber u,
myplan_majors_categories_assoc t2,
myplan_majors t3,
myplan_school_majors_assoc t4
WHERE t1.id = t2.category_id
AND t2.type='cert'
AND t2.cip=t3.cip
AND t3.cip=t4.cipcode
AND t4.certificate_number > 0
AND t1.uber_id=u.id
ORDER BY t1.display_order
i'm checking these queries in phpMyAdmin...and there are no 'prev/next' buttons so i can see all the results...i'm just checking the totals returned.
totally puzzling here....phpMyAdmin bug or mySQL bug? is my grasp of logic wrong?