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