当前位置:网站首页>常用sql语句收藏
常用sql语句收藏
2022-04-23 05:55:00 【ZHZHK001】
查询当前用户下:所有表的行数
适用于:oracle
select t.table_name,t.num_rows from user_tables t ORDER BY num_rows DESC ,table_name
如果以上sql查询不到,执行以下脚本后重新运行上面的句子即可【我是直接就可运行的】
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;
版权声明
本文为[ZHZHK001]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_43142925/article/details/119414415
边栏推荐
猜你喜欢
随机推荐
[stepping on the pit] MELD in win11 wsl2 cannot be used normally. Problem repair
Interprocess communication - mutex
useCenterHook
JS实现私有属性
Log writing method (with time)
查漏补缺(八)
Arm common assembly instructions
JS的解析与执行过程
Running QT program in visual Stdio
POJ-The Unique MST
Analysis of fixed point PID code of FOC motor Library
元编程,代理Proxy与反射Reflect
FOC SVPWM function pwmc_ Setphasevoltage parsing
Generate shortcut
约瑟夫序列 线段树 O(nlogn)
Wildcards and special symbols for shell scripts
uniapp 自定义搜索框适配小程序对齐胶囊
Notes on advanced points of C language 2
查漏补缺(五)
导入文件时候 new FormData()