mysql 8.0 使用merge语法错误

刚学sql不久,看sql进阶教程做的练习题,对着答案修改之后,依然不能运行,有大神愿意解答一下吗?

MERGE into Class_A AS A
USING (SELECT * FROM Class_B) AS B
ON (A.id = B.id)
WHEN matched
THEN UPDATE SET A.name = B.name
WHEN NOT matched
    THEN INSERT (id, name)         
         VALUES (B.id, B.name);

workbench的response 是

Error Code: 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 ‘MERGE into Class_A AS A USING (SELECT * FROM Class_B) AS B ON (A.id = B.id) WHEN’ at line 1Error Code: 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 ‘MERGE into Class_A AS A USING (SELECT * FROM Class_B) AS B ON (A.id = B.id) WHEN’ at line 1

讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!