謝晒的PHP網頁設計
聯絡E-mail:
sean0704@gmail.com
站內搜尋
Wednesday, February 13, 2013
[MYSQL] 設定要撈出幾筆資料"LIMIT"
本範例為從0的位置(即第一筆)開始,取出五筆資料。
SELECT * FROM mytable ORDER BY id DESC LIMIT 0,5
也可簡寫成
SELECT * FROM mytable ORDER BY id DESC LIMIT 5
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment