Re: how to duplicate data for few times by SQL command in PG

From: David Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: tsunghan hsieh <tsunghan(dot)hsieh(at)gmail(dot)com>
Cc: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: Re: how to duplicate data for few times by SQL command in PG
Date: 2015-01-22 15:43:09
Message-ID: CAKFQuwZ-8zHAqa0YtVCu-+r1KsDhjXg_3M6mJ2GaauP2t5C1bw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday, January 22, 2015, tsunghan hsieh <tsunghan(dot)hsieh(at)gmail(dot)com>
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
>
> Han
>
> Original Table
> 23
> 45
> 65
> 22
>
> New Table
> 23
> 23
> 23
> 45
> 45
> 45
> 65
> 65
> 65
> 65
> 22
> 22
> 22
> 22
>

Tables do not have order.

Cross join.

David J.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2015-01-22 15:44:26 Re: temporary tables are logged somehow?
Previous Message tsunghan hsieh 2015-01-22 15:37:23 how to duplicate data for few times by SQL command in PG