【发布时间】:2012-11-29 20:32:59
【问题描述】:
这里我要瞎了...似乎在这个 SQL 中找不到错误:
INSERT INTO sankt_groups_order (
parent_group_id,
child_group_id,
order
) VALUES (?,?,?)
ON DUPLICATE KEY UPDATE
order = ?
;
我收到此错误:
SQLSTATE[42000]: Syntax error or access violation:
1064 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 'order ) VALUES ('65',NULL,'3') ON DUPLICATE KEY UPDATE order = '3''
接下来这个 SQL 会按照我的想法做吗?如果丢失,我需要它插入整行,如果存在则更新顺序...我有一个索引使 parent_group_id 和 child_group_id 唯一。
【问题讨论】: