1、新建EMP_COPY表、和EMP表结构相同
CREATE TABLE emp_copy AS SELECT * FROM emp WHERE 1 = 2;
2、执行
SELECT 'comment on column ' || 'emp_copy' || '.' || COLUMN_NAME || ' is ' || '''' ||
COMMENTS || ''';'
FROM USER_COL_COMMENTS
WHERE TABLE_NAME IN ('EMP');
结果如下:
comment on column emp_copy.EMPNO is '従業員番号';
comment on column emp_copy.ENAME is '従業員氏名';
comment on column emp_copy.JOB is '従業員ジョブ';
comment on column emp_copy.MGR is '従業員マネージャ';
comment on column emp_copy.HIREDATE is '従業員入社日';
comment on column emp_copy.SAL is '従業員サラリー';
comment on column emp_copy.COMM is '従業員手当';
comment on column emp_copy.DEPTNO is '従業員部門番号';
3、执行2的结果为新建的表添加注释。