简体   繁体   中英

Display column names with out datatype in MYSQL

show columns from table_name;

The above MYSQL command, displays all column names with data types in a table. I want only the column names with out other information.

Any kind of help is appreciated. Thanks.

SELECT column_name
FROM information_schema.columns
WHERE table_schema = 'db_name'
AND table_name = 'your_table'

SQLFiddle example

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM