当前位置:网站首页>Collection of common SQL statements
Collection of common SQL statements
2022-04-23 17:11:00 【ZHZHK001】
Query the current user : Number of rows in all tables
Apply to :oracle
select t.table_name,t.num_rows from user_tables t ORDER BY num_rows DESC ,table_name
If the above sql No queries , Run the above sentence again after executing the following script 【 I can run it directly 】
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;
Reference resources :https://www.cnblogs.com/luxd/p/6141476.html
版权声明
本文为[ZHZHK001]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230553251565.html
边栏推荐
猜你喜欢
oracle 中快速获取表的列名列表
JS, entries(), keys(), values(), some(), object Assign() traversal array usage
Milvus 2.0 质量保障系统详解
Milvus 2.0 détails du système d'assurance de la qualité
基于51单片机红外无线通讯仿真
Change the password after installing MySQL in Linux
STM32__ 03 - beginner timer
【生活中的逻辑谬误】稻草人谬误和无力反驳不算证明
1-4 configuration executable script of nodejs installation
Clickhouse table engine
随机推荐
Redis docker installation
Kingdee Cloud Star API calling practice
Using quartz under. Net core -- preliminary understanding of [2] operations and triggers
matlab如何绘制已知公式的曲线图,Excel怎么绘制函数曲线图像?
ASP. Net core dependency injection service life cycle
线性代数感悟之2
Shell-awk命令的使用
ClickHouse-SQL 操作
RPC核心概念理解
Path environment variable
Shell脚本——Shell编程规范及变量
XTask与Kotlin Coroutine的使用对比
Tencent resolves the address according to the IP address
网络安全之渗透靶场实战详解
【生活中的逻辑谬误】稻草人谬误和无力反驳不算证明
Further optimize Baidu map data visualization
【WPF绑定3】 ListView基础绑定和数据模板绑定
freeCodeCamp----prob_ Calculator exercise
Feign report 400 processing
Using quartz under. Net core -- operation transfer parameters of [3] operation and trigger