我试图从现有表(wp_postmeta)中提取数据并将meta_value插入新表(cigar_flavor_scoring)。数据应该基于post_id,我只想从wp_postmeta表中使用焦糖' caramel'来提取数据。我想取下那个值并将其插入到cigar_flavor_scoring表中,焦糖列。
我觉得我非常接近。
SELECT meta_value
FROM wp_postmeta
UPDATE cigar_flavor_scoring
INNER JOIN cigar_flavor_scoring ON (wp_postmeta.post_id = cigar_flavor_scoring.post_id)
WHERE meta_key = "caramel"
SET cigar_flavor_scoring.caramel = wp_postmeta.meta_value