Kyokasuigetsu Kyokasuigetsu - 1 year ago 76
MySQL Question

How to select only fieldname when using show columns query in mysql

I use this query to select fields in a given table. Is it possible to select only the fieldname and not the whole structure of the table?


Answer Source

You're trying to determine the table structure? You can query MySQL's information_schema database directly for the fieldnames:

select COLUMN_NAME from information_schema.COLUMNS where TABLE_NAME='student';
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download