需求:按name字段分类,并按time字段升(降)序排列
原始数据:
运行sql语句:
select * from test order by name,time desc
结果:
备注:可以在查询基础上再用where语句查询
例如:select top 1 * from (select * from test order by name,time desc) where name = "啊啊"