Why is my SQL failing? I think it s formatted correctly, but it throws an error at me.
INSERT INTO NBOT_USERS
(ID,LAST_NAME,FIRST_NAME)
VALUES
(1002, 'Smith', 'John')
WHERE 1002 NOT IN (SELECT IT_ID FROM NBOT_USERS);
Why is my SQL failing? I think it s formatted correctly, but it throws an error at me.
INSERT INTO NBOT_USERS
(ID,LAST_NAME,FIRST_NAME)
VALUES
(1002, 'Smith', 'John')
WHERE 1002 NOT IN (SELECT IT_ID FROM NBOT_USERS);
Inserting Values with a Subquery: Example
With your schema:
Insert queries do not have where clauses, unless you're doing
INSERT ... SELECT FROM
, in which case there can be a where clause in the SELECT portion.