asp中按数字大小排列数据

2025-02-28 19:06:34
推荐回答(2个)
回答1:

在SQL语句后面添加Order By 字段名 ASC[/DESC]

其中加ASC或不加ASC表示升序排列,加DESC表示降序排列

以你问题为例:
如果要实现按hits字段降序排列,SQL语句的写法是:

Select title from [article] order by hits DESC

如果是想按hits升序排列,SQL语句写法是:

Select title from [article] order by hits



Select title from [article] order by hits ASC

回答2:

Sql="Select title from [article] order by hits desc"

Rs,Open Sql,Conn,1,1
……
Response.write Rs(0)
……