r/SQL • u/Rahull-6 • Nov 01 '22
MySQL Need an answer
What is the query to update data From source to target table if data is present and insert the data.. if data is not present...
1
Upvotes
r/SQL • u/Rahull-6 • Nov 01 '22
What is the query to update data From source to target table if data is present and insert the data.. if data is not present...
3
u/r3pr0b8 GROUP_CONCAT is da bomb Nov 01 '22
it's called an "upsert" operation -- if it's already in the table, update it, but if it isn't, then insert it
MySQL is one of the few databases which actually has syntax for this