- Querying all users ' tables, views, etc.
Select * from All_tab_comments;
2. Query This user's table, view, etc.
Select * from User_tab_comments;
3. Query the column names and comments for all users ' tables
Select * from All_col_comments;
4. Query the column names and comments for this user's table
Select * from User_col_comments;
5. Query the column names of all users ' tables (detailed but no notes)
Select * from All_tab_columns;
6. Query the user's table column name and other information (detailed but no notes)
Select * from User_tab_columns;
7. General use 1
Select from User_tab_comments t;
8. General use 2
Select R1, R2, R3, R5 from (Select a.table_name R1, A.column_name R2, a.comments R3 from user_col_comments a), (Select from user_tab_comments t) where = R1;
How to query the table name, primary key name, index, foreign key, and so on for all user tables in Oracle
1. Find all indexes of the table (including index name, type, constituent column)
SELECT T.*, i.index_type fromWHERE= i.index_name and = i.table_name and=' table to query ';
2. lookup table's primary key (including name, constituent column)
SELECT CU.* fromWHERE= AU. Constraint_name and='P' and =' table to query ';
3. Find a table's uniqueness constraints (including name, constituent columns)
SELECT column_name from WHERE= AU. Constraint_name and='U' and =' table to query ';
4. Find the foreign key of the table (including the name, the table name of the reference table and the corresponding key name, which is divided into multi-step query)
The first step:
Select * from where = ' R ' and = ' the table to query ';
Step two: Query the column name of the FOREIGN KEY constraint
Select * from where = ' FOREIGN Key Name ';
Step three: Query the column name of the key referencing the table
Select * from where = ' Key name of foreign key reference table ';
5. Querying all columns and their properties of a table
SELECT T.*, c.comments fromWHERE= c.table_name and = c.column_name and = ' the table to query ';
Transferred from: http://www.2cto.com/database/201212/174394.html