[code]
select
concat('lastname',char(44),'firstname',char(44),'email')
into outfile 'file.csv';
[/code]

I generally use concat() to generate csv file for certain clients.