前情提要:
我要从mongodb里取出数据,存到mysql里
我想根据①找到② 根据②=③,往里填④
刚开始一直困惑成了用inset,后来才想明白是update
结论:
法一:
UPDATE details_copy1 set d_translation_content='789789' where d_id = (select aid from associated_copy1 where object_id="6448e5832f8d26a45c97f2af")
UPDATE details_copy1 set d_translation_content='789789' where d_id in (select aid from associated_copy1 where object_id="6448e5832f8d26a45c97f2af")
法二:
UPDATE details a LEFT JOIN associated b ON a.d_id = b.aid SET d_translation_content = "rrrrrrrr1111111rrrr" WHERE object_id ="1111133"