Please let me know if this is possibe, and how to do it.

hi,
can some one let me know how to achive the o/p mentioned below.
with  target as
(select 100 profile , 2 key , 'XYZ' value  from dual union all
select  100,2,'ABC' from dual union all
select  100,2,'CDE' from dual union all
select  100,3,'300' from dual union all
select  100,3,'301' from dual union all
select  100,4,'400' from dual union all
select  100,4,'401' from dual
select ROWNUM, T.* from target T; O/P : 3 X 2 X 2: = 12 ROWS
100/2-XYZ/3-300/4-400
100/2-XYZ/3-300/4-401
100/2-XYZ/3-301/4-400
100/2-XYZ/3-301/4-401
100/2-ABC/3-300/4-400
100/2-ABC/3-300/4-401
100/2-ABC/3-301/4-400
100/2-ABC/3-301/4-401
100/2-CDE/3-300/4-400
100/2-CDE/3-300/4-401
100/2-CDE/3-301/4-400
100/2-CDE/3-301/4-401Edited by: DeepakDevarapalli on Dec 11, 2009 10:31 AM

Hi,
DeepakDevarapalli wrote:
why this doesnt workIt does work, for certain requirements.
You never explained what your requirements are, so nobody knows it it works for your requirements or not.
You didn't provide the results you want from the new set of sample data, so it makes it very hard to guess.
Instead of key, you may need to use "DENSE_RANK ... ORDER BY key" in the START WITH and CONNECT BY clauses.
For example:
WITH     got_d_rank     AS
     SELECT     profile
     ,     key
     ,     value
     ,     DENSE_RANK () OVER ( PARTITION BY  profile
                               ORDER BY          key
                       )      AS d_rank
     FROM     target
SELECT     profile
     ||
     SYS_CONNECT_BY_PATH ( key || '-' || value
                   )     AS txt
FROM     got_d_rank
WHERE     CONNECT_BY_ISLEAF     = 1
START WITH     d_rank     = 1
CONNECT BY     d_rank     = PRIOR d_rank + 1
     AND     profile     = PRIOR profile
;Sorry, I can't test this now.
Repeat: this is just a guess, based on very little information.

Similar Messages

Maybe you are looking for

  • Download SmartForms in SAP R/3 4.6d / 4.7

    Sorry if this posted in the wrong place. My customer is using Smartforms with SAP R/3 4.6d and 4.7. I need to get a sample of SmartForms from them. I am not sure if that version of SAP allows users to download/upload SmartForms in XML format. If not,

  • Indesign pdf on web page

    Evening Forum am i wrong in thinking i can use an indesign pdf on a web page like i do a normal pdf or jpg? i have had an indesign pdf created by someone, [sorry i dont know what the actual created pdf is called or whether it has a proper name?] and

  • Oracle Sys table index rebuild

    hi, expert I am new to this expert Forums Blow Table Index are rebuild,This table are relation with sys user or not? after rebuild index, getting error in alert log file ORA-00600: internal error code, arguments: [psdnop-1], [1410], [], [], [], [], [

  • Disable Chat in E-commerce B2B

    Dear all, We have a B2B application set up, where the customer would like to remove the "chat" links from the Customer Support page (under "contacts" link). He would like to remove it both from the left side of the screen as well as from the main scr

  • Reason code 0X5006

    Hi all, Today my windows 2012 gets restarted automatically in the morning. Error code is 0X5006 and the process wininit.exe has initiated the restarted of computer ( server name ) on behalf of user for the following reasond. No title for this reason