티스토리 뷰

dev

view_table_info

daily-news 2024. 11. 23. 16:46
create view if not exists view_table_info as
select `information_schema`.`COLUMNS`.`TABLE_NAME`     as `table_name`,
       `information_schema`.`COLUMNS`.`COLUMN_NAME`    as `field`,
       `information_schema`.`COLUMNS`.`COLUMN_COMMENT` as `comment`,
       `information_schema`.`COLUMNS`.`COLUMN_TYPE`    as `type`,
       `information_schema`.`COLUMNS`.`IS_NULLABLE`    as `nullable`,
       `information_schema`.`COLUMNS`.`COLUMN_KEY`     as `key_type`,
       `information_schema`.`COLUMNS`.`COLUMN_DEFAULT` as `default_value`,
       `information_schema`.`COLUMNS`.`EXTRA`          as `extra`
from `INFORMATION_SCHEMA`.`COLUMNS`
where `information_schema`.`COLUMNS`.`TABLE_SCHEMA` = 'csq';

 

테이블정보를 확인하는 View 를 생성해두면.. 편리한 부분이 있어요 ^^

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday