열을 하나의 테이블로 병합하는 방법은 무엇입니까?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
각 행마다 두 번째 테이블과의 관계가 필요합니다 ... 각 행은 동일한 행 수를가집니다. – c0d1ng