排序的依据是哪个字段? 假设该字段名为time select top 1 * from yourTable order by time desc
SELECT TOP 1 * FROM TABLENAME ORDER FIELDNAME DESC 把TABLENAME改成你的表名,FIELDName改成你要排序的字段名。
select top 1 * from [表名] order by [排序字段名] desc
最好的方法是用游标来实现.. 想取表中的哪一行就取哪一行...declare cursor_Name cursor scroll for select * from 表 order by 1 open cursor_Name fetch last from cursor_Name close cursor_Name deallocate cursor_Name
假设该字段名为time
select top 1 * from yourTable order by time desc
把TABLENAME改成你的表名,FIELDName改成你要排序的字段名。
想取表中的哪一行就取哪一行...declare cursor_Name cursor scroll for
select * from 表
order by 1
open cursor_Name
fetch last from cursor_Name
close cursor_Name
deallocate cursor_Name