Oralce queries all empty tables _
1. Analysis
There are three key points:
USER_TABLES (TABS) Underline for fuzzy query _ processing ORACLE-ANALYZE
1.1.USER _ TABLES (TABS)
USER_TABLES (TABS): views of all tables of the current user.
The figure contains the table name (TABLE_NAME), number of records (NUM_ROWS), and other information.
For example, to query all the table names and records under the current user:
Select TABLE_NAME, NUM_ROWS from tabs;
1. 2. Underline _ processing of fuzzy queries
In the fuzzy query of Oralce, _ cannot be used as an underline for matching.
Because _ identifies any character in fuzzy match.
Escape using the escape keyword.
For example, to query all tables starting with AB:
Analyze table table_name compute statistics for table;
2. Write SQL
1. analyze all qualified tables
Select 'analyze table' | t. TABLE_NAME | 'compute statistics for table; 'from user_tables t where t. TABLE_NAME like' AB \ _ % 'escape '\';
2. Perform ORACLE-ANALYZE
Place the execution result of the preceding SQL statement in the Command window for execution.
3. Write and execute query statements
Select t. TABLE_NAME, t. NUM_ROWS from tabs t where t. NUM_ROWS = 0 and t. TABLE_NAME like 'AB \ _ % 'escape' \ 'and t. NUM_ROWS = 0;