MySQL | DB명세서(Table 명세서) 쿼리로 출력 하기
페이지 정보
작성자 100K5 작성일13-06-28 16:54 조회58,634회 댓글0건관련링크
본문
SELECT
t1.table_name as 테이블 명, t1.table_comment as 테이블설 명, column_name as 컬럼 명,
data_type as 데이터 유형, column_type as 데이터 길이, column_key as 키,
is_nullable as 필수, column_default as 초기값, extra as 비고, column_comment as 컬럼설명
FROM(SELECT
table_name, table_comment
FROM
information_schema.TABLES WHERE table_schema='데이터베이스_이름') t1,
(SELECT
(SELECT
table_name, column_name, data_type, column_type, column_key, is_nullable, column_default, extra, column_comment, ordinal_position
FROM
FROM
information_schema.COLUMNS WHERE table_schema='데이터베이스_이름') t2
WHERE
WHERE
t1.table_name = t2.table_name
ORDER BY
ORDER BY
t1.table_name, ordinal_position;
댓글목록
등록된 댓글이 없습니다.