-1

I have a list of strings. For exmaple,

'up', 'down', 'left', 'right'

I need to combine these separate strings into one string, with their commas. Like this

'up, down, left, right'

Does anyone have any ideas how to do this in Oracle?

Zolt
  • 2,761
  • 8
  • 43
  • 60
  • every string is a row or are separated fields? – Juan Carlos Oropeza Dec 11 '15 at 07:00
  • They are not rows. They are individual values that come this way from an SSRS report. They user checks off multiple option from a drop down and then they are sent to sql like on first example, as separate strings, separated with commas. Think of it as `select 'up', 'down', 'left', 'right' from dual` – Zolt Dec 11 '15 at 07:03
  • No, this is not a duplicate, it is different. – Zolt Dec 11 '15 at 07:04

1 Answers1

0

CONCAT OPERATOR is ||

 select 'up' || ','  || 'down' ||  ','  ||  'left' ','  ||  'right' 
 from dual
Juan Carlos Oropeza
  • 47,252
  • 12
  • 78
  • 118
  • Is there a function that will do this? Such as `MakeIntoOneString('up', 'down', 'left', 'right')` ? The way I'm getting the strings this would be the best way for me. – Zolt Dec 11 '15 at 07:09
  • Can you give me a reason why using `||` doesnt work for you. Maybe if i understand the context can help you better – Juan Carlos Oropeza Dec 11 '15 at 07:12
  • If you have it as fields you use `||` if you have it like rows you use https://oracle-base.com/articles/misc/string-aggregation-techniques – Juan Carlos Oropeza Dec 11 '15 at 07:15