1.把B表的数据查询出新增到A表去
INSERT INTO a(id,name)
SELECT b.id as id,b.name as name FROM b;
2.B表的字段满足不了A的情况下
‘name’
是对应type ,now()是对应的create_date
INSERT INTO dim_attach (type,bill_id,url,create_date) select 'name', a.id AS bill_id, a.head_address AS url,now()
FROM
dim_people a
转载:https://blog.csdn.net/weixin_44520739/article/details/109182598
查看评论