Watch the 7.3 Webinar On-Demand
This new release brings updates to Universal Storage, query
optimization, and usability that you won’t want to miss.
Shows the CREATE VIEW
statement that was used to create the view.
SHOW CREATE VIEW view_name
view_name
The name of the view.
Create View
field from the output can be used to recreate the view.character_set_client
and collation_connection
. See List of Engine Variables for more information.The following example displays the output of SHOW CREATE VIEW
.
CREATE VIEW count AS SELECT COUNT(*) FROM square WHERE num > 5;
SHOW CREATE VIEW count;
****
+-------+--------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
| View | Create View | character_set_client | collation_connection |
+-------+--------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
| count | CREATE DEFINER=`root`@`%` SCHEMA_BINDING=OFF VIEW `count` AS SELECT COUNT(*) AS `COUNT(*)` FROM `square` as `square` WHERE (`square`.`num` > 0) | utf8 | utf8_general_ci |
+-------+--------------------------------------------------------------------------------------------------------------------------------------------------+----------------------+----------------------+
Related Topics