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

2015-01-23 Thread Raymond O'Donnell
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? -

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

2015-01-22 Thread tsunghan hsieh
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

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

2015-01-22 Thread Paul Jungwirth
Hi Han, Here is an example: create table foo (v integer); insert into foo values (23), (45), (65), (22); create table bar (v integer); insert into bar select v from foo, generate_series(1,5); But note that in any relational database there is no defined order for the rows. A table is more like a

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

2015-01-22 Thread David Johnston
On Thursday, January 22, 2015, 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 > > Han > > Original Table