日期:2014-05-18 浏览次数:20427 次
declare @table table (A int,B int,C int,D int) insert into @table select 1,2,2,3 union all select 1,2,3,4 union all select 2,4,4,5 union all select 2,3,5,6 union all select 2,2,4,7 ;with maco as( select row_number() over (partition by A order by newid()) as rid, * from @table) select A ,B ,C ,D from maco where rid=1
------解决方案--------------------
select a,min(b),min(c),min(d) from tb group by a
------解决方案--------------------