MySQL 뷰 목록 조회

(MySQL 뷰 목록 보기에서 넘어옴)

1 개요[ | ]

How to get a list of MySQL views
MySQL 뷰 목록 조회

2 방법 1: SHOW FULL TABLES[ | ]

SHOW FULL TABLES IN 디비명
WHERE TABLE_TYPE LIKE 'VIEW';
mysql> SHOW FULL TABLES IN mydb1 WHERE TABLE_TYPE LIKE 'VIEW';
+-----------------+------------+
| Tables_in_mydb1 | Table_type |
+-----------------+------------+
| myview1         | VIEW       |
| myview2         | VIEW       |
+-----------------+------------+
2 row in set (0.00 sec)

3 방법 2: information_schema[ | ]

SELECT TABLE_NAME
FROM information_schema.`TABLES`
WHERE TABLE_TYPE LIKE 'VIEW'
AND TABLE_SCHEMA LIKE '디비명';
mysql> SELECT TABLE_NAME FROM information_schema.`TABLES` WHERE TABLE_TYPE LIKE 'VIEW' AND TABLE_SCHEMA LIKE 'mydb1';
+------------+
| TABLE_NAME |
+------------+
| myview1    |
| myview2    |
+------------+
2 row in set (0.00 sec)

4 같이 보기[ | ]

5 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}