0

I'm running some queries where i need to return multiple fields of a table in one field as a comma separated string

i'm looking for something along these lines but i'm not sure of the exact code:

   SELECT STRINGUP('FIELD1', 'FIELD2', 'FIELD3')NEWFIELDNAME FROM ...

using Oracle SQL Developer

Cheers

mattisrowe
  • 149
  • 2
  • 14
  • Please do a little research. I searched for "concatenation string Oracle SQL stackoverflow". Look at this answer, http://stackoverflow.com/questions/1619259/oracle-sql-concatenate-multiple-columns-add-text. – Patrick Bacon Apr 14 '15 at 12:25
  • Sorry, i'm pretty new to development, if i'd known it was called concatenation i'd have found it. thanks though. – mattisrowe Apr 14 '15 at 13:36

1 Answers1

1
SELECT 'FIELD1' || ',' || 'FIELD2' || ',' || 'FIELD3' AS NEWFIELDNAME FROM ...
davegreen100
  • 2,055
  • 3
  • 13
  • 24