Re: [GENERAL] How to create a specific table

2015-01-23 Thread Alban Hertroys
> On 22 Jan 2015, at 15:54, Pierre Hsieh wrote: > rule: > 1. just one column which type is integer in table > 2. this columns only has 1 and 2 for 50 times as following > > 1 > 2 > 1 > 2 > 1 > 2 > 1 > 2 > . create table test as select b from generate_series(1,50) s1(a), generate_series(1,2

Re: [GENERAL] How to create a specific table

2015-01-22 Thread John R Pierce
On 1/22/2015 6:54 AM, Pierre Hsieh wrote: 1. just one column which type is integer in table 2. this columns only has 1 and 2 for 50 times as following note that tables are unordered sets, the rows of a table have no implied order.1 1 1 1 1 2 2 2 2 2 is the same table as 1 2 1 2 1 2 1 2 1 2

Re: [GENERAL] How to create a specific table

2015-01-22 Thread Michael Paquier
On Thu, Jan 22, 2015 at 11:59 PM, David G Johnston wrote: > Pierre Hsieh wrote >> 1. just one column which type is integer in table >> 2. this columns only has 1 and 2 for 50 times as following > use generate_series(...), the modulus operator (to determine even/odd via > %2), and +1 Yes, embedded

Re: [GENERAL] How to create a specific table

2015-01-22 Thread Adrian Klaver
On 01/22/2015 06:54 AM, Pierre Hsieh wrote: Hi, Is there anyone who can help me to create a specific table as following? Thanks The commands you will need are here: http://www.postgresql.org/docs/9.3/interactive/sql-commands.html In particular: CREATE TABLE http://www.postgresql.org/docs/9.

Re: [GENERAL] How to create a specific table

2015-01-22 Thread David G Johnston
Pierre Hsieh wrote > Hi, > > Is there anyone who can help me to create a specific table as following? > Thanks > > Pierre > > rule: > 1. just one column which type is integer in table > 2. this columns only has 1 and 2 for 50 times as following > > 1 > 2 > 1 > 2 > 1 > 2 > 1 > 2 > . use gen

[GENERAL] How to create a specific table

2015-01-22 Thread Pierre Hsieh
Hi, Is there anyone who can help me to create a specific table as following? Thanks Pierre rule: 1. just one column which type is integer in table 2. this columns only has 1 and 2 for 50 times as following 1 2 1 2 1 2 1 2 .