給表加註釋sql
COMMENT ON TABLE land.landsellmend IS '補辦出讓';
查看錶的COMMENT
spa
SELECT * FROM USER_TAB_COMMENTS WHERE TABLE_NAME=upper('表名');
給字段加註釋
code
comment on column document.doc.bid is '批號';
查看字段的COMMENT
ci
SELECT * FROM USER_COL_COMMENTS WHERE TABLE_NAME=upper('表名');
查看字段的詳細信息io
select A.column_name 字段名,A.data_type 數據類型,A.data_length 長度,A.data_precision 整數位, A.Data_Scale 小數位,A.nullable 容許空值,A.Data_default 缺省值,B.comments 備註 from user_tab_columns A,user_col_comments B where A.Table_Name = B.Table_Name and A.Column_Name = B.Column_Name and A.Table_Name = upper('表名')
查看錶名和註釋table
select A.table_name 表名,B.comments 備註 from tabs A,user_tab_comments B where A.Table_Name = B.Table_Name