鉴于查询'SELECT foo FROM bar WHERE a = x AND b = y OR c = z'
,它如何解析此查询?
(a = x AND b = y) OR c = z
?
a = x AND (b = y OR c = z)
?
这是一个简单的例子,但是如果你正在混合和匹配AND/OR甚至更多的搜索条件呢?
(a = x AND b = y)或c = z
http://dev.mysql.com/doc/refman/5.0/en/operator-precedence.html