Drush sql-query output

Despite several tries, I have never had any luck using the native sql output formatting commands to work with drush

drush sqlq "SELECT nid, title, alias from node
LEFT JOIN url_alias ON url_alias.source = CONCAT('node/', node.nid)
INTO OUTFILE '/home/nick/Desktop/booga.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
WHERE type = 'blog' AND url_alias.alias IS NULL;"

A command like this always seem to result in a failed query.

As a workaround I use awk to format the output. It looks something like this:

drush sqlq "SELECT nid, title, alias from node
LEFT JOIN url_alias ON url_alias.source = CONCAT('node/', node.nid)
LEFT JOIN field_data_field_myfield ON node.nid = field_data_field_myfield.entity_id
WHERE type = 'blog' AND field_data_field_myfield.entity_id IS NULL;"| awk 'BEGIN { FS = "\t"} ; {print """$1"",""$2"",""$3"""}' > output.csv

A nice benefit of this is that it outputs the file wherever I am in my terminal when I run the command.

section: