《Mysql應(yīng)用MySql中取前幾行數(shù)據(jù)使用limit來完成》要點:
本文介紹了Mysql應(yīng)用MySql中取前幾行數(shù)據(jù)使用limit來完成,希望對您有用。如果有疑問,可以聯(lián)系我們。
在mysql中是沒有top關(guān)鍵字的,在mysql中可以用limit來完成功能.
order by id desc limit 10 按照id的倒序排序 取出前10條
order by id desc limit 0,10 按照id的倒序排序 取出前10條
order by id limit 5,10 按照id的正序排序 從第5條開始取10條
代碼如下:
SELECT cat_id FROM shop_goods_type order by cat_id desc limit 1
轉(zhuǎn)載請注明本頁網(wǎng)址:
http://www.fzlkiss.com/jiaocheng/5263.html