COMMENT ON 的用法

Oracle中用comment on命令给表或字段加以说明。

用法如下:

1.对表的说明:
comment on table table_name is '对表的说明';

2.对表中列的说明:
comment on column table.column_name is '对表中列的说明';

3.查看表的说明

select * from user_tab_comments where table_name = 'employees';

4.查看表中列的说明

select * from user_col_comments where table_name = 'employees';

5.查看数据库中所有表中列的说明

select * from user_col_comments where comments is not null;

6.删除表级或列级说明,即时将其设置为空

comment on table employees is '';
comment on column employees.salary is '';
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容