Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

MYSQL export data with their column names

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel


SHOW COLUMNS FROM 

But i dont know if i can use it for that

Thanks !!

ps: i’m a beginner lol

>Solution :

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');
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading