获取所有表的列表相知道相应用户下有哪些表,可以通过以下 SQL 语句进行查询
代码语言:javascript代码运行次数:0运行复制select table_name from user_tables; //当前用户的表
select table_name from all_tables; //所有用户的表
select table_name from dba_tables; //包括系统表
select table_name from dba_tables where owner='xxx' 示例:
查看表结构(1)可以在 SQL 界面通过 desc 表名来查看
(2)也可以通过以下 SQL 语句查询
代码语言:javascript代码运行次数:0运行复制select *
from user_tab_columns
where table_name='要查询的表名';
精准查询:select COLUMN_NAME,DATA_TYPE,DATA_LENGTH from user_tab_columns where table_name='表名';
查看某表的注释代码语言:javascript代码运行次数:0运行复制select *
from user_tab_comments
where Table_Name='表名'查看某表的字段注释代码语言:javascript代码运行次数:0运行复制select *
from user_col_comments
where Table_Name='表名'