sql 未知表结构 取最后一条数据

来源:百度知道 编辑:UC知道 时间:2024/05/29 12:56:31
不知表里面有什么字段,有无自增字段,也就没办法这样做:

select top 1 * from table1 order by FID desc

求一句话,取出未知表结构,中最后一条数据。

select top 1 * from table1 order by FID desc

asp版:
for i=0 to rs.fields(i).count
response.write "字段名称:"&rs.fields(i).name&" 值:"&rs.fields(i).value
end if

select count(*) from table1;得到表中记录数
select * from table1 where rowid=得到的记录数;

用游标吧