Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 1.69 KB

sql-statement-show-create-table.md

File metadata and controls

59 lines (41 loc) · 1.69 KB
title summary aliases
SHOW CREATE TABLE
TiDB 数据库中 SHOW CREATE TABLE 的使用概况。
/docs-cn/dev/sql-statements/sql-statement-show-create-table/
/docs-cn/dev/reference/sql/statements/show-create-table/

SHOW CREATE TABLE

SHOW CREATE TABLE 语句用于显示用 SQL 重新创建已有表的确切语句。

语法图

ShowCreateTableStmt:

ShowCreateTableStmt

TableName:

TableName

示例

{{< copyable "sql" >}}

CREATE TABLE t1 (a INT);
Query OK, 0 rows affected (0.12 sec)

{{< copyable "sql" >}}

SHOW CREATE TABLE t1;
+-------+------------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                               |
+-------+------------------------------------------------------------------------------------------------------------+
| t1    | CREATE TABLE `t1` (
  `a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

MySQL 兼容性

SHOW CREATE TABLE 语句与 MySQL 完全兼容。如发现任何兼容性差异,请尝试 TiDB 支持资源

另请参阅