Re: How to create a specific table - Mailing list pgsql-general

From David G Johnston
Subject Re: How to create a specific table
Date
Msg-id 1421938793554-5835026.post@n5.nabble.com
Whole thread Raw
In response to How to create a specific table  (Pierre Hsieh <pierre.hsieh@gmail.com>)
Responses Re: How to create a specific table
List pgsql-general
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 generate_series(...), the modulus operator (to determine even/odd via
%2), and +1

HTH

David J.




--
View this message in context: http://postgresql.nabble.com/How-to-create-a-specific-table-tp5835024p5835026.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


pgsql-general by date:

Previous
From: Pierre Hsieh
Date:
Subject: How to create a specific table
Next
From: Adrian Klaver
Date:
Subject: Re: How to create a specific table