Home  >  Article  >  Database  >  How to query the number of rows in a table in oracle

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

WBOY
WBOYOriginal
2022-03-01 11:06:5317833browse

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

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 ...;

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!

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