This is an oracle sql. SQL servel says “there is no USERS Table” but user table exists in my db.
MERGE INTO USERS USING DUAL ON (id='001') WHEN MATCHED THEN UPDATE SET no='002' ,from_date = TO_DATE('20-07-01 00:00:00', 'YY-MM-DD HH24:MI:SS') WHEN NOT MATCHED THEN INSERT USERS (id,no,from_date) VALUES ('02','t002',TO_DATE('20-07-01 00:00:00', 'YY-MM-DD HH24:MI:SS'));
Advertisement
Answer
You don’t need the table name.
MERGE INTO USERS USING DUAL ON (id='001') WHEN MATCHED THEN UPDATE SET no='002' ,from_date = TO_DATE('20-07-01 00:00:00', 'YY-MM-DD HH24:MI:SS') WHEN NOT MATCHED THEN INSERT (id,no,from_date) VALUES ('02','t002',TO_DATE('20-07-01 00:00:00', 'YY-MM-DD HH24:MI:SS'));