I have a table with this structure
TABLE #1 --------------------------------------------------------------------------- meta_id | post_id | meta_key | meta_value | --------------------------------------------------------------------------- 1234 5 thumbnail_url http://www.domain/thumb.jpg 1235 5 swf_url http://www.domain/flash.swf 1236 5 description This is a description. 1237 6 thumbnail_url http://www.domain/thumb.jpg 1238 6 swf_url http://www.domain/flash.swf 1239 6 description This is a description. ---------------------------------------------------------------------------
and another table with this structure
TABLE #2 ---------------------------------------------------- ID | post_title | thumbnail | swf | description ---------------------------------------------------- 5 Awesome Title NULL NULL NULL 6 Stack Over Flow NULL NULL NULL ----------------------------------------------------
I need to copy and paste over the meta values from Table 1 over to Table 2 WHERE post_id = ID.
Any insights on how the query would look like would be greatly appreciated.
SQL Fiddle Demo