日记首页
|
列表
|
添加日记
|
管理登陆
标题:asp里的排序
<div style=""><font face="Arial"><span style="font-size: 14px;">asp 排序及同时按照多个字段排序</span></font></div><div style=""><font face="Arial"><span style="font-size: 14px;">例:(ip-look.asp)</span></font></div><div style=""><font face="Arial"><span style="font-size: 14px;">”sql="select * from Ip order by id desc"</span></font></div><div style=""><span style="font-family: Arial; font-size: 14px;"><!--</span><font face="Arial"><span style="font-size: 14px;">rom后面是数据库的表名</span></font><span style="font-family: Arial; font-size: 14px;">--> </span></div><div style=""><font face="Arial"><span style="font-size: 14px;"><!--这是排序语句,表示表名IP里的id数据按倒序排列。--> </span></font></div><div style=""><font face="Arial"><span style="font-size: 14px;"><br></span></font></div><div style=""><font face="Arial"><span style="font-size: 14px;">多个字段排序只需要加上逗号即可,如下</span></font></div><div style=""><font face="Arial"><span style="font-size: 14px;">select * from 表 order by id asc,Game asc</span></font></div><div style=""><font face="Arial"><span style="font-size: 14px;"><br></span></font></div><div style=""><font face="Arial"><span style="font-size: 14px;"><div>排序的是id字段和gam字段,asc表示顺序排序,desc表示倒序。</div><div>多个排序的话,order by 只写一次,后面的排序用逗号隔开:</div><div>select * from [表] order by id asc,gam asc</div></span></font></div>