Hello readers, today we will discuss about the "SQL query with INNER JOIN".
UPDATE
(SELECT table1.value as OLD, table2.CODE as NEW
FROM table1
INNER JOIN table2
ON table1.value = table2.DESC
WHERE table1.UPDATETYPE='blah'
) t
SET t.OLD = t.NEW
The above query will update the data in table1 and table2.
here we are updating the table1 data like :- WHERE table1.UPDATETYPE='blah'
I hope it helps you.
Thank-you readers.
0 Comment(s)