Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL Query

skvApr 6 2016 — edited Apr 7 2016

Hi,

I am working on Oracle 11g Release 2 in Lynux.  I have one table with one column and each row contains multiple years with ';' as delimiter.  Same year may exists in different rows.  I would like to get distinct year from the table in multiple rows.  Here is the example -

with tab as (select '2001;2002;2003' year_list from dual union select '2004;2005'  from dual union select '2004;2005;2006' from dual)
select * from tab;


I would like to get output like below

Year

------

2001
2002
2003
2004
2005
2006

Thank for the help.

This post has been answered by Tubby on Apr 6 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 5 2016
Added on Apr 6 2016
4 comments
265 views