這裏是我的查詢:爲什麼我的語法錯誤沒有無效令牌?
"UPDATE tbl_pedidos_produtos SET status = CASE
WHEN id IN (SELECT produto_id FROM tbl_pedidos_cotacaos_produtos) THEN 4
ELSE 3 END WHERE pedido_id = ".$pedidosExpirados[$i]["pedido_id"]
然後:
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 3
我真的不知道我在做什麼錯。這個不成立。
嘗試把',而不是僅僅'END' END CASE'。 –
這實際上給了我另外一個錯誤:'在第3行使用'CASE WHERE pedido_id = 1'附近的正確語法' –
是的,對不起。這是存儲程序。 –