Re: generate number of rows form a column value

From: Michael Austin <maustin_at_firstdbasource.com>
Date: Wed, 15 Apr 2009 08:26:50 -0500
Message-ID: <p8lFl.16418$D32.3303_at_flpi146.ffdc.sbc.com>



newhorizon wrote:
> create table test_table ( isim varchar2(50), cnt number);
> insert into test_table values ('John', 1) ;
> insert into test_table values ('Dave', 2) ;
> insert into test_table values ('Simit', 3) ;
> insert into test_table values ('TEST', 0) ;
>
>
> How can I generate an output like the following :
>
>
> John 1
> Dave 2
> Dave 2
> Simit 3
> Simit 3
> Simit 3
>
> Release of ora10gR2
>

just curious, but, why would you want to duplicate your data? What happens when that number is 100? 1000? 100000000?

Sounds like a job for PL/SQL -

select data into cursor
parse data
display/output required results.
goto next value

Most database applications want to limit the number of "duplicates" rather than creating duplicates... Received on Wed Apr 15 2009 - 08:26:50 CDT

Original text of this message