mysql 中 and和or 一起使用和之间的优先级
SELECT address,job_title,education,SUM(recruiting) FROM commerce_jobs WHERE education = '大专' and ( job_title LIKE '%主管%' OR job_title LIKE '%组长%' OR job_title LIKE '%主任%' OR job_title LIKE '%项目经理%' )
标红部分的() 括号。and 比 or具有更高的优先级,所以不加括号他就从左到右开始判断
优先级 运算符 (最高) ! -(负号),~(按位取反) ^(按位异或) *,/(DIV),%(MOD) +,- >>,<< & | =(比较运算),<=>,<,<=,>,>=,!=,<>,IN,IS NULL,LIKE,REGEXP BETWEEN AND,CASE,WHEN,THEN,ELSE NOT &&,AND XOR ||,OR (最低) =(赋值运算),:=