34,594
社区成员
发帖
与我相关
我的任务
分享
SELECT #T.* INTO table年级 FROM
(SELECT * FROM table班级01 UNION ALL
SELECT * FROM table班级02) #T
insert into 学校的表
select name ,sex, age from table班级01
union all
select name ,sex, age from table班级02
select
*
into tb
from(
select '班级01' as 班级,* from [班级01]
union all
select '班级02' as 班级,* from [班级02]
) t
create table 学年表(班级ID int,班级名 varchar(20),name varchar(20), sex int, age int )
insert 学年表
select 1,'班级01',* from table1
union all
select 2,'班级02',* from table2
union all
......
select * from tb1
union all
select * from tb2
union all
....