锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久国产精品久久精品,欧美亚洲日本,亚洲成人一区二区三区http://www.aygfsteel.com/star/category/30597.html瀛︿範(fàn)絎旇zh-cnMon, 07 Apr 2008 01:15:15 GMTMon, 07 Apr 2008 01:15:15 GMT60LIMIThttp://www.aygfsteel.com/star/articles/191129.htmlstarstarSun, 06 Apr 2008 15:47:00 GMThttp://www.aygfsteel.com/star/articles/191129.htmlhttp://www.aygfsteel.com/star/comments/191129.htmlhttp://www.aygfsteel.com/star/articles/191129.html#Feedback0http://www.aygfsteel.com/star/comments/commentRss/191129.htmlhttp://www.aygfsteel.com/star/services/trackbacks/191129.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 non-negative integer constants (except when using prepared statements).

With two arguments, the first argument specifies the offset of the first row to return, and the second specifies the maximum number of rows to return. The offset of the initial row is 0 (not 1):

SELECT * FROM tbl LIMIT 5,10;  # Retrieve rows 6-15

To retrieve all rows from a certain offset up to the end of the result set, you can use some large number for the second parameter. This statement retrieves all rows from the 96th row to the last:

SELECT * FROM tbl LIMIT 95,18446744073709551615;

With one argument, the value specifies the number of rows to return from the beginning of the result set:

SELECT * FROM tbl LIMIT 5;     # Retrieve first 5 rows

In other words, LIMIT row_count is equivalent to LIMIT 0, row_count.

For prepared statements, you can use placeholders. The following statements will return one row from the tbl table:

SET @a=1;
PREPARE STMT FROM 'SELECT * FROM tbl LIMIT ?';
EXECUTE STMT USING @a;

The following statements will return the second to sixth row from the tbl table:

SET @skip=1; SET @numrows=5;
PREPARE STMT FROM 'SELECT * FROM tbl LIMIT ?, ?';
EXECUTE STMT USING @skip, @numrows;

For compatibility with PostgreSQL, MySQL also supports the LIMIT row_count OFFSET offset syntax.

(select * order by id LIMIT 35,20)



star 2008-04-06 23:47 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 军事| 巩留县| 宝鸡市| 龙井市| 长海县| 共和县| 久治县| 天津市| 罗定市| 平昌县| 贵德县| 双辽市| 柳河县| 政和县| 常山县| 无为县| 邳州市| 宝丰县| 武城县| 祁门县| 南京市| 收藏| 云南省| 乳山市| 肇州县| 宣化县| 济源市| 江华| 积石山| 鹤山市| 彩票| 武城县| 中西区| 始兴县| 托里县| 定襄县| 舞钢市| 武陟县| 彭泽县| 商城县| 菏泽市|