0

I have a column whose values are 3,8,11. I just want to concatenate with a separator.

The output should be 3-8-11. I don't have any condition or group by parameter.

How can I write an oracle query for this?

Ben
  • 51,770
  • 36
  • 127
  • 149
Rajeena Safeer
  • 91
  • 1
  • 1
  • 4
  • 4
    Did [my comment](http://stackoverflow.com/questions/17906105/oracle-query-to-find-all-occurences-of-a-charcter-in-a-string/17906575#comment26255569_17906575) and [SQL Fiddle](http://www.sqlfiddle.com/#!4/d41d8/15010) not give you enough information already? If you're not using 11.2 you need to state this in your question. – Ben Jul 31 '13 at 07:06
  • Hi Ben ,I have to add one more id field now,it's like select mtr_id ,listagg(str,'#') within group(order by lvl) "flags" from(select mtr_id, instr(mtr_ctrl_flags,'R', 1, level) as str , level as lvl from mer_trans_reject connect by level <= regexp_count(mtr_ctrl_flags, 'R')group by mtr_id); – Rajeena Safeer Jul 31 '13 at 08:34

0 Answers0