-1

I have one problem need to solve in oracle :

i/p :

O
R
A
C
L
E

O/P :

ORACLE
Yogesh Sharma
  • 49,870
  • 5
  • 26
  • 52
  • 1
    As you can see in hundreds of similiar questions on SO: use `listagg()`. – Ponder Stibbons Mar 11 '20 at 17:06
  • 1
    Does this answer your question? [SQL Query to concatenate column values from multiple rows in Oracle](https://stackoverflow.com/questions/4686543/sql-query-to-concatenate-column-values-from-multiple-rows-in-oracle) – Ergi Nushi Mar 11 '20 at 17:13
  • Here are [all the ways](https://stackoverflow.com/q/468990/146325) to suit whichever version of Oracle you're using. – APC Mar 11 '20 at 17:40
  • Are we to assume this is a column in a table with each value in it's own row, or a single column value containing a string with embedded carriage returns you need to remove? – Gary_W Mar 11 '20 at 21:02

1 Answers1

0

Assuming this is a column in a table, here's an example using listagg() that may work for you

    select 
    listagg(your_column) within group (order by rn) new_column
    from (select rownum rn, your_column from your_table)
    ;

Demo here

vishnudattan
  • 476
  • 3
  • 10