Home > Blockchain >  MYSQL export data with their column names
MYSQL export data with their column names

Time:11-05

I import data in excel from mysql and i want get the names of columns.

I do this final command for import the data and i just want have the headers of each columns and of the two tables of the join

SELECT * FROM direction_prix_proxi.matrice_sigma ref LEFT JOIN direction_prix_proxi.volumestest using(SIGMA)

I know the command


SHOW COLUMNS FROM 

But i dont know if i can use it for that

Thanks !!

ps: i'm a beginner lol

CodePudding user response:

If you want to select the headers of multiple tables (i.e. through a join), then you cannot use

SHOW COLUMNS FROM ...

Instead, try using:

SELECT column_name -- or use CONCAT_WS('.', table_name, column_name)
FROM information_schema.columns 
WHERE table_name IN ('matrice_sigma', 'volumetest');
  • Related