我的问题是我想从 tbl_one 查询 x 行并遍历结果并将值插入其他表
select id as user_id, p_id from users where b_id = 0 // this will give me let's say 10 rows
现在我想使用每一行插入到地址表中
insert into addresses (user_id, passenger_id, address_type, address_line1, city, country) value (user_id, passenger_id, 'Test street address', 'XXX', "XX")
我怎么能在mysql中做到这一点。尝试从https://dev.mysql.com/doc/refman/5.7/en/loop.html搜索 mysql 文档,但是解释的循环逻辑非常静态,我不明白。