是这样的:MySQL的:和/或质疑
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'
好吧然后我搞砸了谢谢你有一个愉快的一天 – 2010-08-11 16:50:43
AND'将始终优先于'OR',而不仅仅是在MySQL中。 – FrustratedWithFormsDesigner 2010-08-11 16:54:11
@Frustrated不一定。在那里有一些奇怪的运算符优先规则。短暂聊天。出于这个原因,我是一个狂热的狂热分子。 – deinst 2010-08-11 17:03:34