oracle数据库查看表和表字段的语句

版权声明:未经允许,不得转载 https://blog.csdn.net/dhj199181/article/details/83583164

1.查看当前用户的表 

select * from user_tables tt where tt.TABLE_NAME=upper('表名称');

2.查看表对应的字段 

select * from user_tab_columns t3 where t3.TABLE_NAME=upper('表名称');

3.查看表注释 

select * from user_tab_comments t3 where t3.TABLE_NAME=upper('表名称');

4.查看表对应的字段注释 

select * from user_col_comments t5 where t5.TABLE_NAME=upper('表名称');

5.查看表拥有的索引

select * from user_indexes where table_name=upper('表名称');

6.表增加字段

alter table 表名称 add  字段名称 字段类型;

7.表字段注释

comment on column 表名称.表字段 is '注释内容'; 

8.修改表字段类型

alter table 表名称 modify (字段 数据类型);

9.表字段重命名

alter table 表名称 rename column 旧字段名称 to 新字段名称;

10.删除表字段

alter table 表名称 drop column 表字段;

11.添加/修改表注释

comment on table 表名称is '注释';



 

猜你喜欢

转载自blog.csdn.net/dhj199181/article/details/83583164