CREATE proc distincts (@a varchar(20),@b varchar(20),@c varchar(20),@d varchar(20),@e varchar(20))
as
begin
select ROW_NUMBER() over(order by (select 0)) AS ROWNUM,empno into #test from(
select @a as empno
union all
select @b as empno
union all
select @c as empno
union all
select @d as empno
union all
select @e as empno
)aa
select
empno,rownum,
ROW_NUMBER () OVER (
PARTITION BY empno
ORDER BY
ROWNUM DESC
) AS row_bank into #bb from #test
select empno from #bb
where row_bank=1 and ISNULL(empno,'')<>''
order by ROWNUM asc
drop table #test
drop table #bb
end
快递申请审核流程1
最新推荐文章于 2023-11-08 09:36:31 发布