22,209
社区成员
发帖
与我相关
我的任务
分享
select a,min(b),min(c),min(d) from tb group by a
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