天猫商场同款什么意思:select top 18 * from news order by hits Desc
来源:百度文库 编辑:查人人中国名人网 时间:2024/06/10 17:30:19
为什么我用此句的时候,返回的不是18行,而是21行呢?
top15没问题,但我要的是top18啊,哪个大虾知道
没有加什么呀,就这么一句
top15没问题,但我要的是top18啊,哪个大虾知道
没有加什么呀,就这么一句
top语句选择的时候,你的语句是从hits字段降序选择前十八个。假设你的hits是数字,从大到小第18个记录的hits字段假设是3,但是你的数据库表中hits字段值是3的记录却不止一个(由你所说可知有4个),这时候并列18的记录会被全部读出.这就是你top18却读出21条记录的原因.
一般需要前18条时,你得在逻辑设计的时候就确保hits字段的值不会有重复才行。
怪了,那就写 top 15 吧
还有没有其它字段啊。如果有就在那个order by 后面再加上一个了。比如:
order by hits desc and time desc
select top 18 * from news order by hits Desc
select top 8 lvl=2,* from什么意思
sql = "Select top 5 * from news"
怎么读第二条记录sql="select top 1 * from NEWS whe
select top 3 a1,b1 from c1 where ...怎么写搜索最后3条的语句?
select top 1 count(username) as tot from userdb where status = 1怎么理解呀?
stb="select top 1 id FROM our order by id "
sql="select top 10 * from jjh_news where news_fenlei="&Request("news_fenlei")
asp中 sqlcp="select top 16 * from xnzj order by ArticleID desc"是什么意思
SqlDataAdapter temp_ada = new SqlDataAdapter("select TOP 17 * from "+Lei+"",temp_con);