Oracle查询数据库中所有表的记录数
1、Oracle查询数据库中所有表的记录数,但是有可能不准建议用第二种方式进行查询
select t.table_name,t.num_rows from user_tables t
2、创建oracle函数,通过函数中查询词表记录数显示当前记录数
create or replace function count_rows(table_name in varchar2,
owner in varchar2 default null)
return number authid current_user IS
num_rows number;
stmt varchar2(2000);
begin
if owner is null then
stmt := 'select count(*) from "' || table_name || '"';
else
stmt := 'select count(*) from "' || owner || '"."' || table_name || '"';
end if;
execute immediate stmt
into num_rows;
return num_rows;
end;
之后执行:select table_name, count_rows(table_name) nrows from user_tables
就可以准确查询到记录数
Oracle查询数据库中所有表的记录数的更多相关文章
- 36. Oracle查询数据库中所有表的记录数
select t.table_name,t.num_rows from user_tables t
- mysql 查看数据库中所有表的记录数
use information_schema; SELECT DISTINCT t.table_name, t.engine '表引擎', t.table_rowsFROM TABLES tWHERE ...
- sql查询数据库中所有表的记录条数,以及占用磁盘空间大小。
SELECT TableName = obj.name, TotalRows = prt.rows, [SpaceUsed(KB)] = SUM(alloc.used_pages)* FROM sys ...
- 查询SqlServer中每张表的记录数
select schema_name(t.schema_id) as [ Schema ], t. name as TableName,i. rows as [RowCount] from sys.t ...
- sql server查询数据库中所有表的行数
select a.name,b.rows from sysobjects a,sysindexes b where a.name = b.name order by b.rows desc
- 4. mysql 查看数据库中所有表的记录数
use information_schema; select table_name,table_rows from tables where TABLE_SCHEMA = 'testdb' orde ...
- MySql 查询数据库中所有表名
查询数据库中所有表名select table_name from information_schema.tables where table_schema='csdb' and table_type= ...
- MySql 查询数据库中所有表名以及对比分布式库中字段和表的不同
查询数据库中所有表名select table_name from information_schema.tables where table_schema='数据库名' and table_type= ...
- 利用SQL语句查询数据库中所有表
Oracle: SELECT * FROM ALL_TABLES;系统里有权限的表 SELECT * FROM DBA_TABLES; 系统表 SELECT * FROM USER_TABLES; 当 ...
随机推荐
- canvas-9NonZeroAroundPrinciples2.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- apache配置-html碎片shtml格式
修改SSI 文件 conf–httpd.conf <Directory "D:/Android/Apache2.2/htdocs"> //修改文件目录 # # Pos ...
- iPhone X手机投屏电脑无线连接教程
iPhone X手机是一款非常有气场的手机,独特的设计,展现手机的独特魅力,手机外观让人一眼就爱上,手感也是超级的舒适,真的是堪称完美,但是iPhone X手机投屏电脑怎么无线连接呢? 使用工具: 电 ...
- iOS---------- MBProgressHUD (1.0.0)的变动
1.改变菊花的颜色 // hud.color = [UIColor blackColor];--------------> hud.bezelView.color =[UIColor b ...
- 并发工具箱 concurrent包的原理分析以及使用
1.java.util.concurrent 包下的类分类图 locks部分:显式锁(互斥锁和速写锁)相关: atomic部分:原子变量类相关,是构建非阻塞算法的基础: executor部分:线程池相 ...
- loadrunner 脚本优化-参数化方法
脚本优化-参数化方法 by:授客 QQ:1033553122 方法一 1.确定需要参数化的内容 2.选中需要参数化的内容 3.右键选中的内容->Replace with a Parameter- ...
- log4j.properties配置说明
log4j.properties配置说明 1. log4j配置 # ALL,DEBUG,INFO,WARN,ERROR,FATAL,OFF LOG_LEVEL=INFO log4j.rootLogge ...
- HttpWebRequest 请求带OAuth2 授权的webapi
OAuth 2.0注意事项: 1. 获取access_token时,请使用POST private static string GetAuthorization(string username, st ...
- java单元测试
单元测试 1.简介 在日常开发中,我们编写的任何代码都需要经过严谨的测试才可以发布.以往的测试方法都是通过编写一个main函数进行简单的测试,并使用大量的print语句输出结果,这种方法其实是不可取的 ...
- 洗礼灵魂,修炼python(70)--爬虫篇—补充知识:json模块
在前面的某一篇中,说完了pickle,但我相信好多朋友都不懂到底有什么用,那么到了爬虫篇,它就大有用处了,而和pickle很相似的就是JSON模块 JSON 1.简介 1)JSON(JavaScrip ...