SELECT
COLUMN_NAME AS 'field_name',
COLUMN_COMMENT AS 'comment',
COLUMN_TYPE AS 'type',
COLUMN_KEY AS 'KEY',
IS_NULLABLE AS 'NULL',
EXTRA AS 'auto',
COLUMN_DEFAULT 'default'
FROM INFORMATION_SCHEMA.COLUMNS
WHERE
TABLE_NAME = '테이블명' AND
TABLE_SCHEMA = '스키마명' AND
COLUMN_NAME != 'created_at' AND
COLUMN_NAME != 'updated_at' AND
COLUMN_NAME != 'is_deleted'
ORDER BY TABLE_NAME, ORDINAL_POSITION;
'DB > MYSQL' 카테고리의 다른 글
[ Mariadb ] 원격 쉘 접속 (0) | 2024.06.24 |
---|---|
[ MYSQL ] RDS maria db client connection (0) | 2024.06.05 |
[ MYSQL ] INSERT INTO FROM SELECT (0) | 2023.08.07 |
[ MYSQL ] 생성된 테이블의 DDL 획득; (0) | 2023.07.31 |
[ MYSQL ] Proccess Kill (0) | 2022.10.20 |