网站首页 mysql技术
mysql--OR与AND的优先级
发布时间:2016-10-12 01:00查看次数:4727
select * from `pkGame` where genrns = "粉丝赛" and (status = "开始" or status = "发起" or status ="结束") and `pkGame`.`deleted_at` is null
当前这条SQL 如果 (status = "开始" or status = "发起" or status ="结束") 不用优先级运算括号起来,会导致AND的优先级比or高 取错误的数据
关键字词:mysql--OR与AND的优先级