建表的時候爲了之後查詢方便,也爲了減小數據庫文檔的編寫,建表最好加上表的註釋和列的註釋數據庫
建表語句:文檔
CREATE table "TABLE_COUNT"it
(
"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 '業務發生日期';table
commit;;select
查詢語句:數據
select *from user_tab_comments where table_name='TABLE_COUNT';查詢
select *from user_col_comments where table_name='TABLE_COUNT';註釋