SELECT post_id, GROUP_CONCAT(meta_value) as full FROM wp_postmeta WHERE (meta_key = ‘isc_image_source’ or meta_key = ‘isc_image_source_url’) GROUP BY post_id;
This article provides more details.
If you’d then like to update a second table with the information from the first, here’s an example of how to do this:
UPDATE wp_posts
INNER JOIN (SELECT post_id, group_concat(meta_value) as full FROM wp_postmeta WHERE (meta_key = ‘isc_image_source’ or meta_key = ‘isc_image_source_url’) GROUP BY post_id) a ON (wp_posts.id = a.post_id)
SET post_content = a.full;