[Mysql]테이블 명세서 추출

mysql에서 테이블 명세서를 추출한다.

SELECT a.table_name
     , a.table_comment
     , b.ordinal_position
     , b.column_name
     , b.column_key
     , b.is_nullable
     , b.column_type
     , b.column_default
     , b.column_comment
  FROM information_schema.tables a
           INNER JOIN information_schema.columns b
                   ON a.table_schema = b.table_schema AND a.table_name = b.table_name
 WHERE a.table_schema = '스키마명'
   AND a.table_name = '테이블명';

You may also like...

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다