我寫了一個存儲過程heidisql(Mysql),其運行良好,並獲得所需的輸出。 我試圖在phpmyadmin中運行相同的代碼,並得到錯誤#1604。 insert into tmp_table_rule2 (reward_id) select (reward_id) from vbw_redemptions order by redemption_id desc limit rule2_rede
我有一個表與3個通用鍵也是外鍵。這是我的查詢 - IF (EXISTS(SELECT * FROM table1 WHERE col_1 =4))
BEGIN
UPDATE table1
SET col_2 = 3,
col_3 = 100
WHERE col_1 = 4
END
ELSE
BEGIN