Re: How to create a specific table

From: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to create a specific table
Date: 2015-01-22 14:59:53
Message-ID: 1421938793554-5835026.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-01-22 15:00:49 Re: How to create a specific table
Previous Message Pierre Hsieh 2015-01-22 14:54:58 How to create a specific table