2
我有一个表测试MySQL的 - 更新/外壳
TestNumber (int primary key)
InactiveBitwise (int)
我让下面的命令:
UPDATE tests SET CASE
WHEN TestNumber = 2 THEN InactiveBitwise = (InactiveBitwise | 4)
WHEN TestNumber = 3 THEN InactiveBitwise = (InactiveBitwise | 8)
END WHERE TestNumber IN (2, 3)
但它给错
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CASE WHEN TestNumber = 2 THEN InactiveBitwise = (InactiveBitwise |'
两个TestNumber = 2, 3存在,因为我之前从调用数据库中获得它们。
有谁知道它不喜欢什么?
谢谢,这工作了魅力。 – Rewind