澳门金沙viporacle中用comment on的用法

澳门金沙vip,oracle中用comment on命令给表或字段加以说明,语法如下:复制代码 代码如下:COMMENT ON { TABLE [ schema.
] { table | view } | COLUMN [ schema. ] { table. | view. |
materialized_view. } column | OPERATOR [ schema. ] operator |
INDEXTYPE [ schema. ] indextype | MATERIALIZED VIEW materialized_view
}IS ‘text’ ;

oracle中用comment on命令给表或字段加以说明,语法如下:
COMMENT ON
  { TABLE [ schema. ]
    { table | view }
  | COLUMN [ schema. ]
    { table. | view. | materialized_view. } column
  | OPERATOR [ schema. ] operator
  | INDEXTYPE [ schema. ] indextype
  | MATERIALIZED VIEW materialized_view
  }
IS ‘text’ ;用法如下:
1.对表的说明
comment on table table_name is
‘comments_on_tab_information’;2.对表中列的说明
comment on column table.column_name is
‘comments_on_col_information’;3.查看表的说明
SQL> select * from user_tab_comments where
TABLE_NAME=’EMPLOYEES’;TABLE_NAME                     TABLE_TYPE 
COMMENTS

用法如下:


1.对表的说明复制代码 代码如下:comment on
table table_name is ‘comments_on_tab_information’;

EMPLOYEES                      TABLE       员工表SQL> select * from
user_tab_comments where comments is not
null;TABLE_NAME                     TABLE_TYPE  COMMENTS

2.对表中列的说明复制代码 代码如下:comment
on column table.column_name is ‘comments_on_col_information’;


3.查看表的说明复制代码 代码如下:SQL
select * from user_tab_comments where TABLE_NAME=’EMPLOYEES’;

EMPLOYEES                      TABLE       员工表4.查看表中列的说明
SQL> select * from user_col_comments where
TABLE_NAME=’EMPLOYEES’;TABLE_NAME                    
COLUMN_NAME                    COMMENTS

复制代码 代码如下:TABLE_NAME TABLE_TYPE
COMMENTS—————————— ———– ———-EMPLOYEES
TABLE 员工表


SQL select * from user_tab_comments where comments is not null;


TABLE_NAME TABLE_TYPE COMMENTS——————————
———– ————————–EMPLOYEES TABLE 员工表

EMPLOYEES                      EMPLOYEE_ID                   
EMPLOYEES                      MANAGER_ID                    
EMPLOYEES                      FIRST_NAME                    
EMPLOYEES                      LAST_NAME                     
EMPLOYEES                      TITLE                         
EMPLOYEES                      SALARY                        
员工薪水SQL> select * from user_col_comments where comments is not
null;TABLE_NAME                     COLUMN_NAME                   
COMMENTS

4.查看表中列的说明复制代码 代码如下:SQL
select * from user_col_comments where TABLE_NAME=’EMPLOYEES’;


复制代码 代码如下:TABLE_NAME
COLUMN_NAME COMMENTS——————————
—————————— ————EMPLOYEES EMPLOYEE_ID
EMPLOYEES MANAGER_ID EMPLOYEES FIRST_NAME EMPLOYEES LAST_NAME
EMPLOYEES TITLE EMPLOYEES SALARY 员工薪水