데이터베이스/MySQL
[MySQL] 테이블, 컬럼 코멘트(Comment) 조회
떨어지는 용
2018. 11. 2. 10:46
▶MySQL 테이블, 컬럼 코멘트(Comment) 조회
▶설명
MySQL에서 테이블과 컬럼에 작성되어 있는 코멘트를 조회할 수 있는 방법을 기록했습니다.
▶테이블 코멘트(Comment) 조회
DB 전체 테이블 코멘트 조회
SELECT
table_name, table_comment
FROM
information_schema.tables
WHERE
table_schema = 'DB 이름' AND table_name = '테이블 이름';
DB 특정 테이블 코멘트 조회
SELECT
table_name, table_comment
FROM
information_schema.tables
WHERE
table_schema = 'DB 이름' AND table_name = '테이블 이름';
▶컬럼 코멘트(Comment) 조회
DB 전체 테이블 컬럼 코멘트 조회
SELECT
table_name, column_name, column_comment
FROM
information_schema.columns
WHERE
table_schema = 'DB 이름';
DB 특정 테이블 컬럼 코멘트 조회
SELECT
table_name, column_name, column_comment
FROM
information_schema.columns
WHERE
table_schema = 'DB 이름' AND table_name = '테이블 이름';