[MySQL] 테이블, 컬럼 코멘트(Comment) 조회 > MySQL

본문 바로가기

MySQL

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

회원사진
하나를하더라도최선을
2021-08-29 14:57 2,525 0

본문



출처: https://extbrain.tistory.com/97 [확장형 뇌 저장소]

▶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 = '테이블 이름';



댓글목록0

등록된 댓글이 없습니다.
게시판 전체검색