oracle怎么查詢表的行數

oracle中,可用“num_rows”和“user_tables”來查詢表的行數,“num_rows”列一小時更新一次,語法為“select table_name,num_rows from user_tables where 條件”。

oracle怎么查詢表的行數

本教程操作環境: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視頻教程

以上就是

? 版權聲明
THE END
喜歡就支持一下吧
點贊10 分享