慕勒3428872
直接上demo:create table mytable(id int identity(1,1),[month] int, [insertTime] datetime) insert into mytable values(6 , '2013-6-2' ) insert into mytable values(6 , '2013-6-3' ) insert into mytable values(6 , '2013-6-4' ) insert into mytable values(6 , '2013-6-5' ) insert into mytable values(7 , '2013-7-5' ) insert into mytable values(7 , '2013-7-6' ) insert into mytable values(7 , '2013-7-7' )insert into mytable values(8 , '2013-8-8' )insert into mytable values(9 , '2013-9-9' )go语句:select * from mytable a where id in(select top 2 id from mytable b where a.[month] =b.[month] order by insertTime desc )