Priority of AND and OR operator in Mysql select query [closed]

妖精的绣舞 提交于 2019-12-04 04:09:00

Yes, AND has higher precedence than OR. x and y are bound together, m and q are bound together, then the resulting expressions are ORed.

AND has a higher priority than OR in every programming language I have ever seen, and I've seen several dozen at close quarters, and implemented a few myself. This question was basically settled in 1960 with the Algol-60 report, if not already in Fortran (1957).

[There was one exception but it was a mis-implemented language with no operator precedence at all. I fixed that.]

Yes it will do something like (X AND Y) OR (M AND Q). AND operator's priority is higher than OR.

For more see MySQL: Operator Precedence

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!