当前位置:网站首页>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
边栏推荐
- Handwritten event publish subscribe framework
- C dapper basically uses addition, deletion, modification and query transactions, etc
- TypeError: set_ figure_ params() got an unexpected keyword argument ‘figsize‘
- RTKLIB 2.4.3源码笔记
- Redis docker installation
- Use of Shell sort command
- Shell-awk命令的使用
- How vscode compares the similarities and differences between two files
- Change the password after installing MySQL in Linux
- [problem solving] [show2012] random tree
猜你喜欢
线性代数感悟之2
TypeError: set_ figure_ params() got an unexpected keyword argument ‘figsize‘
Detailed explanation of Milvus 2.0 quality assurance system
CentOS MySQL multi instance deployment
Get the column name list of the table quickly in Oracle
Nodejs installation and environment configuration
Detailed explanation of the penetration of network security in the shooting range
Shell脚本——Shell编程规范及变量
Net standard
ASP. NET CORE3. 1. Solution to login failure after identity registers users
随机推荐
[WPF binding 3] listview basic binding and data template binding
Smart doc + Torna generate interface document
[C] thoroughly understand the deep copy
tidb-server 的配置文件在哪里?
SQL: How to parse Microsoft Transact-SQL Statements in C# and to match the column aliases of a view
freeCodeCamp----prob_ Calculator exercise
Calculation formula related to tolerance analysis
1-4 configuration executable script of nodejs installation
Redis docker installation
Simulation of infrared wireless communication based on 51 single chip microcomputer
Use between nodejs modules
RTKLIB 2.4.3源码笔记
STM32__ 03 - beginner timer
Tencent resolves the address according to the IP address
matlab如何绘制已知公式的曲线图,Excel怎么绘制函数曲线图像?
Path environment variable
手写事件发布订阅框架
Document operation II (5000 word summary)
JS, entries(), keys(), values(), some(), object Assign() traversal array usage
Conversion between hexadecimal numbers