1、小弟想从数据库中读取ID为400的记录后面的100条记录,请教使用SQL语句如何实现。
2、读取到DBGRILD中后,如何将DBGRILD中的记录存出到文本文件中
请大家帮忙或共同探讨,在线等带
SQL="SELECT TOP 100 FROM TABLE WHERE ID>400 ORDER BY ID"
SQL="SELECT TOP 100 FROM TABLE WHERE ID>400 ORDER BY ID DESC"
1.select * from “你的数据库“ where ID between 400 and 500
2.用循环语句读出数据然后写入文件。
例:
open "1.txt" as #1
for i=0 to ?(“你自己定“)
print #1 mydata(i)
close
select top 100 from "数据库名" where customerID >400 order by customerID desc