这是:
update batchinfo set instrument='Instrument 17' where
datapath like '%10497%' or
datapath like '%10506%' or
datapath like '%10516%' or
datapath like '%11081%'
and instrument='Instrument 1'
与此相同:
update batchinfo set instrument='Instrument 17' where
datapath like '%10497%' and instrument='Instrument 1' or
datapath like '%10506%' and instrument='Instrument 1' or
datapath like '%10516%' and instrument='Instrument 1' or
datapath like '%11081%' and instrument='Instrument 1'
最佳答案
否-AND仅符合datapath like '%11081%'
的条件。
不要冒险-使用括号。他们便宜。
关于sql - mysql:或/和问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/3460737/