[thelist] MySQL oddness
r937
rudy at r937.com
Tue Jan 29 08:00:20 CST 2008
your "dodgy" sql is the problem, and will cause an error in version 5
which has stricter rules about evaluating joins
double-check your target server's version, because the dodgy sql should
actually work on 4.1.22
you know how ANDs take precedence over ORs in compound conditions?
mixing JOIN syntax with the old "comma-separated table list" syntax is like
that
you have
FROM snip_map_request `mr`
, snip_course_details `c`
INNER JOIN snip_course_details
ON `c`.`id` = `mr`.`course_id`
notice where the comma is
this means that the following is parsed first --
snip_course_details `c`
INNER JOIN snip_course_details
ON `c`.`id` = `mr`.`course_id`
and of course at this point you get the error about mr.course_id being
unknown
solution? rewrite all your joins so as not to use the (deprecated) old
"comma-separated table list" syntax
rudy
http://r937.com/
More information about the thelist
mailing list