亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 12567 | 回復: 4
打印 上一主題 下一主題

mysql 的limit 問題 [復制鏈接]

論壇徽章:
0
跳轉到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2011-12-23 14:12 |只看該作者 |倒序瀏覽
5可用積分
我就想知道  

  limit的第二個參數(shù) 到底可不可以為 -1


  limit 10,-1 是不是能查出從10到最后一條

  網(wǎng)上的帖子都說可以, 但是在客戶端測試確實不行


  高手請給出確切答案  


論壇徽章:
1
榮譽版主
日期:2011-11-23 16:44:17
2 [報告]
發(fā)表于 2011-12-23 16:20 |只看該作者
不行  報錯

mysql> select * from uc_pms limit 10,-1;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 1

論壇徽章:
4
CU大;照
日期:2013-03-13 15:32:35CU大牛徽章
日期:2013-03-13 15:38:15CU大;照
日期:2013-03-13 15:38:52戌狗
日期:2013-12-27 15:08:11
3 [報告]
發(fā)表于 2011-12-23 16:39 |只看該作者
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1' at line 3
SELECT *
FROM `movie_busi_cart`
LIMIT 10 , -1

確實不能 如果要用到最后幾條記錄 可以加個order by  主鍵嘛 desc limit n

論壇徽章:
0
4 [報告]
發(fā)表于 2013-11-14 14:33 |只看該作者
你這是不看文檔的結果

http://dev.mysql.com/doc/refman/5.5/en/select.html


The LIMIT clause can be used to constrain the number of rows returned by the SELECT statement. LIMIT takes one or two numeric arguments, which must both be nonnegative integer constants, with these exceptions:

    Within prepared statements, LIMIT parameters can be specified using ? placeholder markers.

    Within stored programs, LIMIT parameters can be specified using integer-valued routine parameters or local variables as of MySQL 5.5.6.

您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復

  

北京盛拓優(yōu)訊信息技術有限公司. 版權所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關心和支持過ChinaUnix的朋友們 轉載本站內容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP