select callrates.id, users.usr, callrates.extension, callrates.destination, callrates.calldate, callrates.duration, callrates.description, callrates.stablishment, callrates.rate INTO OUTFILE '/tmp/export_201603.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n' FROM callrates, users WHERE users.id=callrates.user and year(calldate) = 2016 AND month(calldate) = 03;
No hay opción de exportar la cabecera.