No need to overengineer this feature. I imagine a right-click menu item "Execute Selected Query to a CSV file" or something like that.