I have a tablle like this.
cust acc
---------------
a 1
b 2|3
c 4|5|6
I Want below o/p:
cust acc
-----------
a 1
b 2
b 3
c 4
c 5
c 6
Please any one can you have any ideas share me.
I have urgent requirement.
Answer Posted / p deshmukh
SELECT distinct COL, trim(regexp_substr(colvalue, '[^|]+', 1, level)) colvalue
FROM (with demo as ( select '1' as a, '2|3' as b, '4|5|6' as c from dual )
select * from demo
unpivot
( colvalue for col in (a, b, c) )) t
CONNECT BY instr(colvalue, '|', 1, level - 1) > 0
order by col
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
what is myisam? : Sql dba
How do you take the union of two tables in sql?
Explain what is a view?
How do you declare a user-defined exception?
How to return an array from java to pl/sql?
what is bcp? When does it used? : Sql dba
How many columns should be in an index?
does sql support programming? : Sql dba
Can we create table inside stored procedure?
What does where 1 1 mean in sql?
Is sql a dbms?
what are enums used for in mysql? : Sql dba
How does one load ebcdic data? : aql loader
What is percent sign in sql?
what are the properties and different types of sub-queries? : Sql dba