Updating two tables at once
The new MERGE SQL command looks like as below: The MERGE statement basically works as separate insert, update, and delete statements all within the same statement.
You specify a "Source" record set and a "Target" table, and the join between the two.
For example, operations to be performed from the command line.
This chapter points out such equivalences where appropriate.
This new command is similar to the UPSERT (fusion of the words UPDATE and INSERT.) command of Oracle; it inserts rows that don't exist and updates the rows that do exist.
With the introduction of the MERGE SQL command, developers can more effectively handle common data warehousing scenarios, like checking whether a row exists, and then executing an insert or update or delete.
That's probably because for many or most applications, those features don't matter.
I will then use the MERGE SQL command to synchronize the target table with the source table.
Do these omissions mean that My SQL isn't a "real" database system?
Some people think so, but in response I'll simply observe that the lack of these capabilities in My SQL hasn't stopped large numbers of people from using it.
These are capabilities found in some other databases but not in My SQL.
Such features include triggers, stored procedures, and views.