How to convert a MS SQL Merge Query to work with MySQL DB? [closed]
We have an SQL DB with 2 Tables and have an MS SQL
MERGE query that works great...but...
We are hoping to move to MySQL (a more portable solution) and can't find solid documentation on how to get our SQL
MERGE query converted to MySQL...?
Here's the MS SQL query:
MERGE [UpcomingEvents] Ue USING [MCList] MC ON Ue.post_title = MC.post_title WHEN MATCHED THEN UPDATE SET Ue.sku_crmid = MC.sku_crmid
I know we have to drop the
[ ]...but we still can't get it to work...
I don't see the point in using MERGE in the first place since you are only performing UPDATES... there is no INSERT when not matched in the code you provided. If this is truly UPDATE only you could use something like the following (untested)...
UPDATE UpcomingEvents as Ue INNER JOIN MCList AS MC ON (Ue.post_title = MC.post_title) SET Ue.sku_crmid = MC.sku_crmid
- A Linux, Apache, MySQL, PHP (LAMP) stack is a combination of open source software that is typically installed together to enable a server to host dynamic […]
- MySQL is an the most popular open-source database management system, in most of hosting company its has been bundle by LAMP(Linux, Apache, MySQL, PHP/Python/Perl) stack. Another alternative […]
- MySQL is the world’s most popular open-source database. Despite its powerful features, MySQL is simple to set up and easy to use. Below are some instructions […]