Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The difference and demonstration of Oracle, MySQL and SqlServe paging sentences

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report