Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


write a sql query following source looking like below
column1 column2
101,102,103 abc,def,ghi
1001,1002,1003 a,b,c
i want the output
column1 column1
101 abc
102 def
103 ghi
1001 a
1002 b
1003 c

Answer Posted / farrukhshaikh

select vw1.str, vw2.str
from (select rownum sr,
substr(col,
instr(col, ',', 1, level) + 1,
instr(col, ',', 1, level + 1) -
instr(col, ',', 1, level) - 1) str
from (select ',' || qry || ',' col
from (select '101,102,103,1001,1002,1003'
qry from dual))
connect by level <= length(col) - length(replace
(col, ',')) - 1) vw1,
(select rownum sr,
substr(col,
instr(col, ',', 1, level) + 1,
instr(col, ',', 1, level + 1) -
instr(col, ',', 1, level) - 1) str
from (select ',' || qry || ',' col
from (select 'abc,def,ghi,a,b,c' qry from
dual))
connect by level <= length(col) - length(replace
(col, ',')) - 1) vw2
where vw1.sr = vw2.sr

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between sharding and replication?

1017


Database crashes. Corruption is found scattered among the file system neither of your doing nor of Oracles. What database recovery options are available? Database is in archive log mode.

1982


What is the cache hit ratio, what impact does it have on performance of an Oracle database and what is involved in tuning it?

2113


how to convert .db (extention) database file into .dmp (extention ) for oracle database ?

2541


What is catalog in Oracle?

1331


What is the sid in oracle?

951


What is varray?

1108


Please explain drop constraint oracle?

1077


What is the difference between count (*), count (expression), count (distinct expression)?

988


What is different types of joins?

1002


WHAT IS ecc 6.0

2139


What is define in oracle?

1042


How to resolve the ORA-39133 error in Oracle?

1092


Explain what are clusters?

1085


can anyody please send me the dump for Oracle 10g certifications for DBA path?

2108