chen__han1 发表于 2005-12-11 14:08

有时间字段的表如何找最近5条记录,请教了。

现在表里有个时间字段,我想找出最近的5条记录,该怎么找,请教了

hxfly 发表于 2005-12-13 16:15

select top 5 * from 表 order by 时间 desc<BR><BR><BR>不知道这样可以不可以

潇洒老乌龟 发表于 2005-12-13 23:09

你这是SQLSERVER的语言。<br>应该是<br>select * from 表 where nownum &lt;= 5 order by 时间 desc <br>

页: [1]

编程论坛