首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

SQL语句——显示前面8条?解决办法

2012-02-10 
SQL语句——显示前面8条?selectb.*fromproDDasa,productasbwherea.productNOb.IDorderbya.orderbydesc只取

SQL语句——显示前面8条?
select   b.*   from   proDD   as   a,product   as   b   where   a.productNO   =   b.ID   order   by   a.orderby   desc

只取前面8条记录,在select后加top   8怎么没反应?

[解决办法]
by a.orderby 是这样吗,你检查语法了没有啊
[解决办法]
…… order by a.orderby desc,a.productNO desc
如果orderby里有N条相同且并列第8,就都算上了。
[解决办法]
select top 8 b.* from proDD as a,product as b where a.productNO = b.ID order by a.orderby desc

热点排行