求助,如何使用SQL查询出各分类的前二条记录,谢谢
Create Table table1 (Id Int,acctno c(10),bianh c(10),Date c(10))
Insert Into table1 Values (1,'0001','1111','20120102')
Insert Into table1 Values (2,'0001','2222','20120103')
Insert Into table1 Values (3,'0002','9999','20120102')
Insert Into table1 Values (4,'0002','6666','20120104')
Insert Into table1 Values (5,'0001','9999','20120104')
Insert Into table1 Values (6,'0002','6666','20120105')
得出的结果是
1,'0001','1111','20120102'
2,'0001','2222','20120103'
3,'0002','9999','20120102'
4,'0002','6666','20120104'