The difference and demonstration of Oracle, MySQL and SqlServe paging sentences
The following is about the difference and demonstration of Oracle, MySQL and SqlServe paging sentences. The secret of the text is that it is close to the topic. So, no gossip, let's go straight to the following, I believe you will benefit from reading the differences and demonstrations of Oracle, MySQL and SqlServe paging sentences.
1. SqlServe download database paging statement
Java code
String sql = "select top" + pageRecord + "* from addressbook where id not in (select top" + (currentPage-1) * pageRecord + "id from t_user)"
/ / (currentPage-1) * pageRecord: which record does it start from?
Page 2 SQL demo:
Select top 20 * from addressbook where id not in (select top 10 id from addressbook)
II. MySQL database paging statement
Java code
String sql = "select * from addressbook where limit" + (currentPage-1) * pageRecord + "," + pageRecord + ""
/ / select * from table name [condition] limit MMagne
/ / M to start with several records, for example, to display 3 records per page, the second page must start with the fourth record
/ / N read several pieces of data per page
Page 2 SQL demo:
Select * from addressbook where limit 10
III. Oracle database paging statement
Java code
String sqls = "select * from (select rownum rn,t.* from addressbook t where rownum" + (currentPage-1) * pageRecord
Page 2 SQL demo:
Select * from (select rownum rn,t.* from addressbook where rownum 10
Is there anything you don't understand about the differences and demonstration of the above Oracle, MySQL and SqlServe paging sentences? Or if you want to know more about it, you can continue to follow our industry information section.