On 22/01/2015 15:37, tsunghan hsieh wrote:
> Hi
> 
> I have a table which just has one column as following in Original Table.
> I wanna duplicate all of data for few times and with same order as
> following in New Table. Is there anyone who can help me? Thanks

How about something like this? -

        insert into <new table>
        select <whatever> from <original table>
        cross join generate_series(1, 3)
        order by <whatever>

This assumes that you want each item duplicated the same number of times.

Hope this helps,

Ray.

-- 
Raymond O'Donnell :: Galway :: Ireland
r...@iol.ie


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to