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

From: tsunghan hsieh <tsunghan(dot)hsieh(at)gmail(dot)com>
To: PostgreSQL <pgsql-general(at)postgresql(dot)org>
Subject: how to duplicate data for few times by SQL command in PG
Date: 2015-01-22 15:37:23
Message-ID: CAFypHLy=TU63JJJFofETUP_T8Dg3G7b6WZN0DR=R-Cmnvgvmpg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David Johnston 2015-01-22 15:43:09 Re: how to duplicate data for few times by SQL command in PG
Previous Message Tom Lane 2015-01-22 15:37:10 Re: partitioning query planner almost always scans all tables