oracle怎么查询表的行数

2023年 4月 15日 30.5k 0

在oracle中,可用“num_rows”和“user_tables”来查询表的行数,“num_rows”列一小时更新一次,语法为“select table_name,num_rows from user_tables where 条件”。 本教程操作环境:Windows10系统、Ora

在oracle中,可用“num_rows”和“user_tables”来查询表的行数,“num_rows”列一小时更新一次,语法为“select table_name,num_rows from user_tables where 条件”。

本教程操作环境:Windows10系统、Oracle 11g版、Dell G3电脑。

oracle怎么查询表的行数

语法为:

select table_name,num_rows from user_tables

在user_tables后面可以添加符合自己的条件,当然如果你有dba权限的话,可以将user_tables换成dba_tables,

num_rows列并不是事实更新的,查新之前最好先ANALYZE下 analyze table 这里写表名compute statistics;

DBA权限下可以查询dba_tables,里面有个num_rows列

select table_name,num_rows from dba_tables where ...;

条件可以根据自己需要来加

num_rows列并不是实时更新的,1小时更新一次。

推荐教程:《Oracle视频教程》

以上就是oracle怎么查询表的行数的详细内容,更多请关注每日运维其它相关文章!

【本文来源:武汉seo公司 http://www.5h5q.com复制请保留原URL】

相关文章

Oracle如何使用授予和撤销权限的语法和示例
Awesome Project: 探索 MatrixOrigin 云原生分布式数据库
下载丨66页PDF,云和恩墨技术通讯(2024年7月刊)
社区版oceanbase安装
Oracle 导出CSV工具-sqluldr2
ETL数据集成丨快速将MySQL数据迁移至Doris数据库

发布评论