mysql show all columns in table code example
Example 1: show table columns mysql command line
SHOW COLUMNS from tablename;
Example 2: MySql get fields of table
SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'my_database' AND TABLE_NAME = 'my_table';
Example 3: mysql all columns
-- MySQL
SELECT *
FROM INFORMATION_SCHEMA.COLUMNS;
Example 4: mysql show table fields
DESCRIBE my_table;