网络编程
位置:首页>> 网络编程>> Asp编程>> 使用SQL语句,查第10-20条记录

使用SQL语句,查第10-20条记录

  发布时间:2008-02-19 18:34:00 

标签:sql,查询,数据库

asp使用SQL语句,查询数据库中的第10-20条记录的l方法,两种sql语句写法如下:

1、

select top 10 * from tablename where id in(select top 20 id from tablename) order by id desc

 

2、

select top 10 * from tablename where id not in(select top 10 id from tablename)

不知道你还有没有其它的方法?欢迎讨论..

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com