mysql:使用select查出的数据进行批量insert

xiaoxiao2025-06-08  17

A,B的表结构

A:a,b,c B:a,b,c

需求

将B表中的a,c字段插入A表中,其中A表的b字段默认为’b’.

code

insert into A (a,b,c) select s.a,'b',s.c from ( select t.a,t.c from B t ) s
转载请注明原文地址: https://www.6miu.com/read-5031494.html

最新回复(0)