建表的时候为了以后查询方便,也为了减少数据库文档的编写,建表最好加上表的注释和列的注释
建表语句:
CREATE table "TABLE_COUNT"
(
"TABLE_NAME" varchar2(40 char) not null enable,
"COUNT" varchar2(40 char) not null enable,
"DESCRIPTION" varchar2(40 char) not null enable,
"FLAG" varchar2(40 char) not null enable,
"CREATE_DATE" varchar2(40 char) not null enable,
PRIMARY KEY ("TABLE_NAME","CREATE_DATE")
);
comment on table "ZX_COUNT" is '每天产生的业务条数';
comment on column "ZX_COUNT"."TABLE_NAME" is '表名';
comment on column "ZX_COUNT"."COUNT" is '发生条数';
comment on column "ZX_COUNT"."DESCRIPTION" is '说明';
comment on column "ZX_COUNT"."FLAG" is '类型标记';
comment on column "ZX_COUNT"."CREATE_DATE" is '业务发生日期';
commit;;
查询语句:
select *from user_tab_comments where table_name='TABLE_COUNT';
select *from user_col_comments where table_name='TABLE_COUNT';