1. select * from trade where id=1 and cid=1 or pid=2 ;
2. select * from trade where cid=1 or (pid=2 and id=1);
3. select * from trade where cid=1 or pid=2 and id=1;
2和3的查询结果是一致的 说明 and 应该是比or的优先级高,
所有1 就相当于( id=1 and cid=1 ) or pid=2 。。
1. select * from trade where id=1 and cid=1 or pid=2 ;
2. select * from trade where cid=1 or (pid=2 and id=1);
3. select * from trade where cid=1 or pid=2 and id=1;
2和3的查询结果是一致的 说明 and 应该是比or的优先级高,
所有1 就相当于( id=1 and cid=1 ) or pid=2 。。