获取最后的记录

时间:2009-05-15 10:21:19

标签: sql ms-access

如何获取最后3条记录?

2 个答案:

答案 0 :(得分:5)

MS Access(注意拼写)使用SQL,因此您可以使用:

SELECT TOP 3 * FROM [tablename] ORDER BY [columnName] DESC

答案 1 :(得分:0)

如果您的桌子上有自动编号字段作为IID,那么

select * from  (select *, (select COUNT(0)  from tableName 
where IID >= thisIsTempNameNotChange.IID)
as INDEX from [tableName] thisIsTempNameNotChange) WHERE INDEX<=3