当前位置:网站首页>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
边栏推荐
猜你喜欢
Node access to Alipay open platform sandbox to achieve payment function
CentOS MySQL multi instance deployment
oracle 中快速获取表的列名列表
Milvus 2.0 détails du système d'assurance de la qualité
Using quartz under. Net core -- operation transfer parameters of [3] operation and trigger
1-1 NodeJS
Solution architect's small bag - 5 types of architecture diagrams
Go language, array, string, slice
groutine
Path environment variable
随机推荐
[PROJECT] small hat takeout (8)
Go language RPC communication
Detailed explanation of the penetration of network security in the shooting range
PHP efficiently reads large files and processes data
Self use learning notes - connectingstring configuration
How does matlab draw the curve of known formula and how does excel draw the function curve image?
Use of shell sed command
EF core in ASP Generate core priority database based on net entity model
2. Electron's HelloWorld
Feign report 400 processing
Milvus 2.0 质量保障系统详解
ASP. Net core reads the configuration file in the class library project
ClickHouse-数据类型
Shell - introduction, variables, and basic syntax
Deep understanding of control inversion and dependency injection
Shell-awk命令的使用
文件操作《二》(5000字总结篇)
MySQL restores data through binlog file
Go language, array, string, slice
El cascade and El select click elsewhere to make the drop-down box disappear