Oracle query the current user and the current all the tables under the user

Reprinted from: http://blog.itpub.net/29485627/viewspace-1246317/

 

Oracle query the current user and the current all the tables under the user

( 1 ) the current user query

SQL> show user

USER is "SCOTT"

 

( 2 ) the current query all the tables under the user, there are three ways

The first:

SQL> select table_name from tabs;

 

TABLE_NAME

--------------------------------------------------------------------------------

DEPT

EMP

BONUS

SALGRADE

WORKERSALARY

WS

 

6 rows selected.

 

The second:

SQL> select table_name from user_tables;

 

TABLE_NAME

--------------------------------------------------------------------------------

DEPT

EMP

BONUS

SALGRADE

WORKERSALARY

WS

 

6 rows selected. 

 

Third:

SQL> select tname from tab;

 

TNAME

--------------------------------------------------------------------------------

DEPT

EMP

BONUS

SALGRADE

WORKERSALARY

WS

 

6 rows selected. 

Guess you like

Origin www.cnblogs.com/isme-zjh/p/11334571.html