Oracle, server, and my SQL syntax differences

Source: Internet
Author: User

1. Summarize the syntax for querying 10-20 Records in Oracle, SQL Server, and MySQL

One: Oracle database notation:

1:select * FROM (select RowNum RN, * from table name wher rownum<20) A

where a.rn>10

2:select * FROM table name where rownum<20

Minus

SELECT * FROM table name where rownum<10

II: SQL Server database notation:

1:select Top * FROM tablename where ID not?exists (select Top ten * from TableName)//First 20 records filter out the first 10

2:select Top10 * FROM (select top to order by column) The ORDER BY column desc//subquery takes 20 reverse, and then takes the first 10 lines from the subquery

Three: MySQL's wording:

SELECT * FROM tablename where LIMIT 9,10

Oracle, server, and my SQL syntax differences

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.