SHOW [FULL] COLUMNS FROM
SHOW [FULL] FIELDS FROM <table_name>
、DESC <table_name>
、DESCRIBE <table_name>
和 EXPLAIN <table_name>
语句都是 SHOW [FULL] COLUMNS FROM
的别名。
ShowStmt:
ShowColumnsFilterable:
FieldsOrColumns:
ShowTableAliasOpt:
FromOrIn:
ShowDatabaseNameOpt:
DBName:
ShowLikeOrWhereOpt:
Query OK, 0 rows affected (0.11 sec)
show columns from v1;
+-------+-----------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
| 1 | bigint(1) | YES | | NULL | |
+-------+-----------+------+------+---------+-------+
1 row in set (0.00 sec)
desc v1;
+-------+-----------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-----------+------+------+---------+-------+
| 1 | bigint(1) | YES | | NULL | |
+-------+-----------+------+------+---------+-------+
1 row in set (0.00 sec)
explain v1;
+-------+-----------+------+------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-----------+------+------+---------+-------+
+-------+-----------+------+------+---------+-------+
1 row in set (0.00 sec)
| Field | Type | Null | Key | Default | Extra |
+-------+-----------+------+------+---------+-------+
| 1 | bigint(1) | YES | | NULL | |
+-------+-----------+------+------+---------+-------+
1 row in set (0.00 sec)
show full columns from v1;
+-------+-----------+-----------+------+------+---------+-------+---------------------------------+---------+
| Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment |
+-------+-----------+-----------+------+------+---------+-------+---------------------------------+---------+
| 1 | bigint(1) | NULL | YES | | NULL | | select,insert,update,references | |
+-------+-----------+-----------+------+------+---------+-------+---------------------------------+---------+
1 row in set (0.00 sec)