文章目录
获取所有表的列表查看表结构查看某表的注释查看某表的字段注释获取所有表的列表
相知道相应用户下有哪些表,可以通过以下 SQL 语句进行查询
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 语句查询
select * from user_tab_columns where table_name='要查询的表名';
精准查询:select COLUMN_NAME,DATA_TYPE,DATA_LENGTH from user_tab_columns where table_name='表名';
查看某表的注释
select * from user_tab_commentswhere Table_Name='表名'
查看某表的字段注释
select * from user_col_comments where Table_Name='表名'
如果觉得《用SQL语句查看Oracle数据表的结构信息》对你有帮助,请点赞、收藏,并留下你的观点哦!