Oracle查询当前用户和当前用户下的所有表
转载自:http://blog.itpub.net/29485627/viewspace-1246317/
Oracle查询当前用户和当前用户下的所有表
(1)查询当前用户
SQL> show user
USER is "SCOTT"
(2)查询当前用户下的所有表,有三种方法
第一种:
SQL> select table_name from tabs;
TABLE_NAME
--------------------------------------------------------------------------------
DEPT
EMP
BONUS
SALGRADE
WORKERSALARY
WS
6 rows selected.
第二种:
SQL> select table_name from user_tables;
TABLE_NAME
--------------------------------------------------------------------------------
DEPT
EMP
BONUS
SALGRADE
WORKERSALARY
WS
6 rows selected.
第三种:
SQL> select tname from tab;
TNAME
--------------------------------------------------------------------------------
DEPT
EMP
BONUS
SALGRADE
WORKERSALARY
WS
6 rows selected.
![](https://images.cnblogs.com/cnblogs_com/isme-zjh/1665628/t_200309175526zhifubao.png?a=1583807649478)
您的资助是我最大的动力!
金额随意,欢迎来赏!