很简单的sql语句:选取数据库日期最近的记录

SELECT * FROM table where time...???
---------------------------------------------------------------

或者加上top n
SELECT top 10 FROM table order by time desc

---------------------------------------------------------------

select top 10 * from table order by time desc
---------------------------------------------------------------

先找出最近的记录的日期,在根据该日期找记录
---------------------------------------------------------------

select * from table where time in (select max(time) from table)
---------------------------------------------------------------

麦子的方法应该可以实现

Published At
Categories with Web编程
Tagged with
comments powered by Disqus