Iam trying to insert a record and i want to check that it is not already present in the table.
I try
INSERT INTO emp (empno, name)
VALUES(2, 'ram')
WHERE empno NOT IN (select empno from emp);
but it shows error ‘incorrect syntax near where‘
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use following query to insert records into emp
If you are inserting one record at a time then following query will work as best as it can …
If you are willing to insert multiple records then just find below query