728x90
반응형
SELECT
t1.table_name, t1.table_comment, column_name, data_type, column_type, column_key, is_nullable, column_default, extra, column_comment
FROM
(SELECT
table_name, table_comment
FROM
information_schema.TABLES WHERE table_schema='WH') t1,
(SELECT
table_name, column_name, data_type, column_type, column_key, is_nullable, column_default, extra, column_comment, ordinal_position
FROM
information_schema.COLUMNS WHERE table_schema='WH') t2
WHERE
t1.table_name = t2.table_name
ORDER BY
t1.table_name, ordinal_position;
SELECT
t1.table_name, t1.table_comment, column_name, data_type, column_type, column_key, is_nullable, column_default, extra, column_comment
FROM
(SELECT
table_name, table_comment
FROM
information_schema.TABLES WHERE table_schema='데이터베이스_이름') t1,
(SELECT
table_name, column_name, data_type, column_type, column_key, is_nullable, column_default, extra, column_comment, ordinal_position
FROM
information_schema.COLUMNS WHERE table_schema='데이터베이스_이름') t2
WHERE
t1.table_name = t2.table_name
ORDER BY
t1.table_name, ordinal_position;
728x90
반응형
'Database > MySQL' 카테고리의 다른 글
MariaDB sharding using docker (0) | 2020.07.14 |
---|---|
MySQL Replication 연결 (0) | 2019.10.22 |
MySQL innodb 버퍼 할당 에러 (0) | 2019.10.22 |
MySQL 프로시저 디버그 (0) | 2019.10.22 |
MySQL error 1364 Field doesn't have a default values (0) | 2019.10.22 |