본문 바로가기
개발자 커뮤니티에 오신 것을 환영합니다!

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

페이지 정보

profile_image
작성자 하나를하더라도최선을
댓글 0건 조회 16,695회 작성일 21-08-29 14:57

본문

출처: 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 = '테이블 이름';



댓글목록

등록된 댓글이 없습니다.


Copyright © program1472 | IT HUB. All rights reserved.