DESCRIBEEmployee\G******** ******************1.row**************************** Field: Id&am"> Is there any other statement in MySQL other than SHOW COLUMNS to get the list of columns in an existing table?-Mysql Tutorial-php.cn

Is there any other statement in MySQL other than SHOW COLUMNS to get the list of columns in an existing table?

WBOY
Release: 2023-09-10 17:09:03
forward
574 people have browsed it

MySQL 中除了 SHOW COLUMNS 之外还有其他语句来获取现有表中的列列表吗?

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)
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!