Skip to content
Advertisement

SQL – copy data from one table column to another table column

As you can see from the image I have a table called wpw8_postmeta where it has four columns and I have searched for the term release and got the following results.

I want to copy the results (release_date [meta_value]) to another table called wpw8_test using the post_id as foreign key/primary key.

enter image description here

The second table looks like this

enter image description here

After the update will be done it should look like this

enter image description here

Advertisement

Answer

You seem to be looking for the update ... join syntax:

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement