表中有A列和B列,对A列数据去重复,对B列数据排序

来源:互联网 发布:钉钉办公软件优缺点 编辑:程序博客网 时间:2024/05/21 07:10
declare @tt  table(a int,b int);insert into @tt values (11,12),(13,13),(11,30),(14,50),(23,12);select * from @tt;select * from (select a,MIN(b) bb from @tt group by a )tab order by bb;或者 select a,MIN(b) as bb from @tt group by a order by bb;

0 0
原创粉丝点击