下面我的 UPDATE_OR_INSERT 代码有什么问题?
MERGE INTO EMAIL_LIST d USING (SELECT 'foo@gmail.com' EMAIL) s
ON (d.EMAIL = s.EMAIL)
WHEN MATCHED THEN
UPDATE SET d.EMAIL = s.EMAIL
WHEN NOT MATCHED THEN
INSERT (EMAIL) VALUES (s.EMAIL);
给定表格:
CREATE TABLE EMAIL_LIST (
EMAIL VARCHAR2 (100) NOT NULL
);
ALTER TABLE EMAIL_LIST
ADD CONSTRAINT PK_EMAIL_LIST PRIMARY KEY ( EMAIL ) ;
错误
错误报告:
SQL 错误:ORA-00923:FROM 关键字未在预期的位置找到 00923。00000 -“FROM 关键字未在预期的位置找到”