oracle and 和 or

源地址:https://zhidao.baidu.com/question/350891282.html

(FirstName='Thomas' OR FirstName='William') AND LastName='Carter' 会得到 lastname 必须为 carter ,firstname 为 thomas  或者 william的人 
thomas carter
william carter

FirstName='Thomas' OR FirstName='William' AND LastName='Carter' 可以得到 william carter 或者 firstname 为ithomas lastname 不一定是 carter的人 比如:
thomas carter
william carter
thomas king


就是 or 和and 的先后顺序的问题, and 的优先级比 or的高 ,a or b and c 先计算 b and c 的结果 再去计算 a 的。
posted on 2016-12-07 14:59  海子呢  阅读(2141)  评论(0编辑  收藏  举报