sql學習之 limit語句使用

來源:互聯網
上載者:User

 limit語句使用

 limit用於返回行數的限制。

  如:

 select *

 from table1

 limit 5;

用於返回檢索的資料集中的前五行。而下面的語句:

select *

from table1

limit 4,10;

用於返回檢索的資料集中的從第4行開始到第10行的資料。

 

總結:

1 limit語句可以用於網頁中的分頁顯示。比如一頁顯示20行。要想顯示第二頁的資料,可以使用:

select *

from table1

limit 2,20;

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.