110,538
社区成员
发帖
与我相关
我的任务
分享
create table #t (a varchar(10),b varchar(10),c varchar(10),d varchar(10),e varchar(10))
insert #t
select '1', '116' ,'34230', '117' ,'34280' union all
select '1', '117' ,'34280', '118' ,'34331' union all
select '1', '118' ,'34331', '119' ,'34382' union all
select '1', '119' ,'34382', '120' ,'34433' union all
select '1', '120' ,'34433', '121' ,'34484' union all
select '1', '121' ,'34484', '122' ,'34534'
select * from #t
select distinct b,c from (select b,c from #t union all select d,e from #t) tb
drop table #t