ASP查询代码如何只查询固定的数值
比如:<%sql="select*from[xmtype]orderby[nu]"rs_t1=myRs(1,sql)%>我想查询7到10的数据。改怎么写。然后1到10查询...
比如:
<%
sql="select * from [xmtype] order by [nu]"
rs_t1=myRs(1,sql)
%>
我想查询7到10的数据。改怎么写。
然后1到10查询出来,11到20的查询出来。该怎么写啊。大神们 展开
<%
sql="select * from [xmtype] order by [nu]"
rs_t1=myRs(1,sql)
%>
我想查询7到10的数据。改怎么写。
然后1到10查询出来,11到20的查询出来。该怎么写啊。大神们 展开
1个回答
2018-05-25
展开全部
假如要查询的字段是ID,那么写法如下“
7-10:sql="select * from [xmtype] where id>6 and id<11 order by [nu]"
1-10:sql="select * from [xmtype] where id>0 and id<11 order by [nu]"
11-20:sql="select * from [xmtype] where id>10 and id<21 order by [nu]"
也可以写成 id>=7 and id<=10
7-10:sql="select * from [xmtype] where id>6 and id<11 order by [nu]"
1-10:sql="select * from [xmtype] where id>0 and id<11 order by [nu]"
11-20:sql="select * from [xmtype] where id>10 and id<21 order by [nu]"
也可以写成 id>=7 and id<=10
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询