当前位置:网站首页>常用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
边栏推荐
猜你喜欢
随机推荐
欢迎使用Markdown编辑器
颜色字符串转换
FOC single resistance sampling position loop control servo motor
JS中的this指向
Multibyte and Unicode in VS
Sdoi2009-hh Necklace
Collection of practical tips for C language (continuously updated)
解析psd文件,并映射成组件
ES6面试题(参考文档)
QT icon application
VHDL-任意分频器(50%占空比)
Set up a personal blog of jpress
el-table添加序号
Node的数据库编程
2020 Jiangsu Collegiate Programming Contest-A.Array
HDU-Memory Control
var、let、const之间的区别
浮点数双精度,单精度以及半精度知识总结
FOC SVPWM函数PWMC_SetPhaseVoltage解析
如何使用input表单向服务发送(占用较小)图片文件(body传输)?涉及到FileReader内置对象








