mysql get column names from table
snippet in sql

MySql get fields of table

user9753

SELECT COLUMN_NAME
  FROM INFORMATION_SCHEMA.COLUMNS
  WHERE TABLE_SCHEMA = 'my_database' AND TABLE_NAME = 'my_table';

mysql get column names from table

user2166

SELECT `COLUMN_NAME` 
FROM `INFORMATION_SCHEMA`.`COLUMNS` 
WHERE `TABLE_SCHEMA`='yourdatabasename' 
    AND `TABLE_NAME`='yourtablename';

mysql to get column name in database

user7424

SELECT table_name, column_name from information_schema.columns WHERE column_name LIKE '%column_name_to_search%';

how to print out column name differently in mysql

user775

-- MySQL

SELECT column1 AS name1, column2 AS name2
FROM table1;

-- AS allows your to replace the name of a column when outputting but does not
-- actually change the column name within the database.