今天用mysql查询的时候,突然发现我在sql语句里面只是换了or关键字两边的顺序,可是查询结果就不一样,
可是or关键字两边不应该是等价的吗?麻烦哪位大神解答一下下面是那两个sql:
select * from question where( qtype = 'blank' AND( qrange like '%sql%' or '%java%')AND qdifficulty = 'primary' AND qstatae = 'pass');
select * from question where( qtype = 'blank' AND( qrange like '%java%' or '%sql%') AND qdifficulty = 'primary' AND qstatae = 'pass');
下面是mysql显示的查询结果(当运行这个sql的时候他会被选中,图片中sql顺序同上面的顺序):