Introduction to paging query in Oracle, SQL, and DB2

Source: Internet
Author: User

The paging query method for Oracle, SQL, and DB2 is different from that for paging query statements in Oracle and SQL, the following describes the differences between DB2 paging query and paging query in other databases. Oracle paging query syntax: 1: Oracle select * from (select rownum, name from table where rownum <= endIndex) where rownum> startIndex 2: DB2 DB2 paging query SELECT * FROM (Select Field 1, Field 2, Field 3, rownumber () over (column name ASC for order by sorting) AS rn from table name) AS a1 WHERE a1.rn BETWEEN 10 AND 20 or above indicates to extract the select * from (select rownumber () over (order by id asc) records from 10th to 20) as rowid from table where rowid <= endIndex) where rowid> startIndex 3: MySQL: select * from table limit start, pageNum
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.