where section like '%c%' and section = 'b' or section = 'b' or section = 'c' or section = 'd' or section = 'e'
执行时顺序应该是左到右还是右到左? 为什么不能找出section=c 的内容呢?
...全文
1535打赏收藏
SQL语句中的AND OR 使用错误
where section like '%c%' and section = 'b' or section = 'b' or section = 'c' or section = 'd' or section = 'e' 执行时顺序应该是左到右还是右到左? 为什么不能找出section=c 的内容呢?
where section like '%c%' and section = 'b' or section = 'b' or section = 'c' or section = 'd' or section = 'e'
等于
where ( section like '%c%' and section = 'b' ) or section = 'b' or section = 'c' or section = 'd' or section = 'e'