mysql查詢語句,通過limit來限制查詢的行數。


mysql查詢語句,通過limit來限制查詢的行數。

 

例如:

select name from usertb where age > 20 limit 0, 1; //限制從第一條開始,顯示1條

select name from usertb where age > 20 limit  1; //同上面的一個效果

select name from usertb where age > 20 limit 4, 1; //顯示從第五條開始,顯示1條

 

select name from usertb order by age desc limit 4; 倒序排列年齡,支線前4行


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM