mysql query return excel file
SELECT ... FROM ... WHERE ...
INTO OUTFILE 'file.csv'
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n';
#Then Open Excel and click on Data tab,
#Click the From Text/CSV button,
#Navigate to the location of the exported .csv file and click Import
#Choose appropriate delimiter "comma"and click Transform Data
#Update column name, Close & Load.