According to the man page for the mysql client:
When used interactively, query results are presented in an ASCII-table format. When used noninteractively (for example, as a filter), the result is presented in tab-separated format.
Your use of -e
is making mysql treat it as an interactive command. But the client can also accept input via stdin. This is what you want:
mysql -N --user=foo --password=bar --host=baz -A db <<-'EOF'
SELECT ...
FROM fieldA, fieldB
LIMIT 100
EOF