用一条SQL语句 把 两个结构相同的表A、B 合并 到

时间:2015/12/1 10:16:00来源:互联网 作者:flyso 点击: 768 次

方法一:

create table C(ID int identity(1,1) primary key,types nchar(10),title char(100),pic char(100))
go
insert into C(types,title,pic) select types,title,pic from A
go
insert into C(types,title,pic) select types,title,pic from B

方法二:

insert   into   C(types,title,pic)   select   types,title,pic   from   A
UNION   ALL   select   types,title,pic   from   B 

Copyright © 2005 - 2016 flyso.cn. 飞搜 版权所有 鄂ICP备11002783号-3