Home >Database >Oracle >How to query the first 10 pieces of data in Oracle

How to query the first 10 pieces of data in Oracle

hzc
hzcOriginal
2020-06-08 14:16:1717400browse

How to query the first 10 pieces of data in OracleQuerying the first 10 pieces of data in oracle:

Querying the first 10 pieces of data in oracle is different from that in sql server.

sql server:

SELECT top 10 * FROM EMP ORDER BY sal DESC;

In sql server, top is used to represent the first 10 pieces of information.

oracle:

SELECT * FROM EMP  WHERE ROWNUM <= 10 ORDER BY sal DESC;

In Oracle, ROWNUM is used to represent the first 10 pieces of information.

Oracle related introduction:

Oracle, the full name of Oracle Corporation (Oracle Software Systems Co., Ltd.), is the world's largest enterprise software company, headquartered in Redwood Beach, California, USA. Officially entered the Chinese market in 1989. In 2013, Oracle surpassed IBM and became the world's second largest software company after Microsoft.

Recommended tutorial: "Oracle Tutorial"

The above is the detailed content of How to query the first 10 pieces of data in Oracle. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn