1.查询库中的表名和表中记录数:
SELECT T.TABLE_NAME, T.NUM_ROWS FROM USER_TABLES T;
2.查询库中记录总数:
SELECT SUM(A.NUM_ROWS) FROM (SELECT T.TABLE_NAME, T.NUM_ROWS FROM USER_TABLES T) A;
3.查询某个用户下所有表记录总数
SELECT SUM(A.NUM_ROWS) FROM (
SELECT T.TABLE_NAME, T.NUM_ROWS FROM USER_TABLES T where T.TABLE_NAME in ( Select distinct a.Table_Name
From Sys.All_Tab_Columns a,
Sys.Dba_Col_Comments b,
Sys.All_Tab_Comments c
Where a.Owner = b.Owner
And a.Table_Name = b.Table_Name
And a.Table_Name = c.Table_Name
And a.Column_Name = b.Column_Name
And a.Owner = ‘GAS_SCYX_BASE’ --用户
)) A;
相关文章
暂无评论...