IT

[MySQL] 테이블, 컬럼 코멘트 조회

data-cloud 2025. 1. 24. 00:35
반응형

 

💾 테이블 코멘트

전체 테이블 코멘트 조회

SELECT 
    table_name, table_comment
FROM
    information_schema.tables
WHERE
    table_schema = 'DB 이름' AND table_name = '테이블 이름';

 

특정 테이블 코멘트 조회

SELECT 
    table_name, table_comment
FROM
    information_schema.tables
WHERE
    table_schema = 'DB 이름' AND table_name = '테이블 이름';

 

반응형

 

💾 컬럼 코멘트

전체 테이블의 컬럼 코멘트 조회

SELECT
    table_name, column_name, column_comment
FROM
    information_schema.columns
WHERE
    table_schema = 'DB 이름';

 

특정 테이블의 컬럼 코멘트 조회

SELECT
    table_name, column_name, column_comment
FROM
    information_schema.columns
WHERE
    table_schema = 'DB 이름' AND table_name = '테이블 이름';
 

 

 

 

References.

1. 확장형 뇌 저장소 - [MySQL] 테이블, 컬럼 코멘트(Comment) 조회

 

반응형