I have previously posted about the SQL MERGE statement, and how powerful it is
Unfortunately, not all databases support this statement. Also, very often it is quite a bit of overkill, when what you want to do is to simply INSERT or UPDATE a single record, depending on whether it already exists.
MySQL’s nice INSERT statement extensions
MySQL has a couple of very nice extensions to the INSERT statement. Some of them are also supported by the CUBRID database. Let’s have a look at two features of the (simplified) syntax definition:
INSERT [IGNORE] [INTO] tbl_name …[Read more]