Given a file which consists of multiple line MySQL queries, eg
SELECT foo, bar, etc
FROM blah
WHERE something or other
LIMIT etc
Is there any way I can visually select a query in Vim, pipe it through MySQL, and see the query and result in a new buffer?
Clarification: I don't want tabular output, but something that can be further processed in vim or imported into a spreadsheet (like the tab-separated output that you get from mysql --batch) (Ubuntu Linux).