I need to copy the content of a source table (val & name columns) to a target table (Using MySQL).
However, I only wish to copy the content if the val fields in the source table are different to the val fields in the target table.
I have the following so far:
QUERY
INSERT INTO target_tbl (val, name) SELECT val, name source_tbl WHERE [CODE_HERE];
INSERT INTO target_tbl
(
val, name
)
SELECT val, name source_tbl
FROM source_tbl
WHERE val
NOT IN
(
SELECT val FROM target_tbl
)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments