如何将列合并到一个表中?tsql将列合并到一个表
declare @map_old table(ID int not null) insert into @map_old select 1 insert into @map_old select 2 declare @map_new table(ID int not null) insert into @map_new select 11 insert into @map_new select 22 declare @map(ID int not null, ID2 int not null)
的结果@map应该是:
ID ID2 1 11 2 22
有什么建议?谢谢!
为什么'1 11',而不是'1 22'?你需要并排粘贴表格吗? – danihp 2012-03-30 09:29:13
我需要每一行与第二个表的关系......每个tabe具有相同的行数。 – c0d1ng 2012-03-30 09:34:18