I have a database where a query on one table results on many records being returned. How do I get the output into CSV format - e.g. "select foo,bar from sometable where foo = '123456789';" should return something like:
123456789,111,222,333,444,555,666,777,888
The values 111, 222, 333, and so on are all vaues returned by running the query in the above sample SQL statement. Normally, SQLPLUS returns something like:
FOO BAR
---------------- -------
123456789 111
123456789 222
123456789 333
...and so on...