Mysql get all fields of table

Mysql get all fields of table

 

 

select COLUMN_NAME from information_schema.COLUMNS where table_name = 'your_table_name';

select COLUMN_NAME from information_schema.COLUMNS where table_name = 'your_table_name' and table_schema = 'your_db_name';

 

Take out all fields and display them on one line (separated by commas)

 

select group_concat(COLUMN_NAME SEPARATOR ',')  from information_schema.COLUMNS where table_name = 'tableName';

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326725237&siteId=291194637