Home > Database > Oracle > body text

How to query the number of rows in a table in oracle

WBOY
Release: 2022-03-01 11:06:53
Original
17923 people have browsed it

In Oracle, "num_rows" and "user_tables" can be used to query the number of rows in the table. The "num_rows" column is updated once an hour. The syntax is "select table_name,num_rows from user_tables where condition".

How to query the number of rows in a table in oracle

The operating environment of this tutorial: Windows 10 system, Oracle 11g version, Dell G3 computer.

How to query the number of rows in a table in oracle

The syntax is:

select table_name,num_rows from user_tables
Copy after login

You can add your own conditions after user_tables. Of course, if you have dba authority, you can add user_tables Change to dba_tables,

num_rows column is not actually updated. Before checking, it is best to ANALYZE analyze table and write the table name compute statistics here;

You can query dba_tables under DBA authority, which contains A num_rows column

select table_name,num_rows from dba_tables where ...;
Copy after login

The conditions can be added according to your own needs

The num_rows column is not updated in real time and is updated once an hour.

Recommended tutorial: "Oracle Video Tutorial"

The above is the detailed content of How to query the number of rows in a table in oracle. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template