Yes, we can use DESCRIBE or EXPLAIN statement instead of SHOW COLUMNS statement to get the existing table List of columns in . In the following example, we have applied the DESCRIBE and EXPLAIN statements on the "Employee" table and obtained the result set obtained after the SHOW COLUMNS statement Same result set -
mysql> DESCRIBE Employee\G *************************** 1. row *************************** Field: Id Type: int(11) Null: YES Key: Default: NULL Extra: *************************** 2. row *************************** Field: Name Type: varchar(20) Null: YES Key: Default: NULL Extra: 2 rows in set (0.05 sec) mysql> Explain Employee\G *************************** 1. row *************************** Field: Id Type: int(11) Null: YES Key: Default: NULL Extra: *************************** 2. row *************************** Field: Name Type: varchar(20) Null: YES Key: Default: NULL Extra: 2 rows in set (0.04 sec)
The above is the detailed content of Is there any other statement in MySQL other than SHOW COLUMNS to get the list of columns in an existing table?. For more information, please follow other related articles on the PHP Chinese website!