+ 2
Can one use a where statement in an insert into statement??
This questions leads to a bigger question: can you insert data with a condition for example when a certain data doesn't exist then add it but if it does don't add it?
3 Answers
+ 3
You actually can
By using the insert into select sql syntax you get to achieve that.
A really good resource on the topic can be found here;
https://www.w3schools.com/sql/sql_insert_into_select.asp
+ 4
I'd say no. Now in a trigger you can have conditions before the insert. Like if an add/update to table A meets the conditions then insert into table B. Google triggers in sql. They're the difference between a dead database and an alive and kicking database.
+ 1
no we can't use it.. if we insert a data which is already exist then it will give us error without condition / where clause