select * from tablename t1 where checksum(*) in (select top 1 checksum(*) from tablename where aaa = t1.aaa)
select * from tablename t1 where checksum(*) = (select top 1 checksum(*) from tablename where aaa = t1.aaa)
如果有IDselect * from [table] where id in (select min(id) from [table] group by aaa)如果没有IDselect identity(int,1,1) as id ,* into # from [table]goselect * from # where id in (select min(id) from # group by aaa)
where checksum(*) in
(select top 1 checksum(*) from tablename where aaa = t1.aaa)
where checksum(*) =
(select top 1 checksum(*) from tablename where aaa = t1.aaa)
where id in (select min(id) from [table] group by aaa)如果没有IDselect identity(int,1,1) as id ,* into # from [table]goselect * from #
where id in (select min(id) from # group by aaa)