DESCRIBEEmployee\G******** ******************1.row**************************** Field: Id&am">
Yes, we can useDESCRIBEorEXPLAINstatement instead ofSHOW COLUMNSstatement to get the existing table List of columns in . In the following example, we have applied theDESCRIBEandEXPLAINstatements on the "Employee" table and obtained the result set obtained after theSHOW COLUMNSstatement 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!