Search Postgresql Archives

Re: How to create a specific table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 22, 2015 at 11:59 PM, David G Johnston
<david.g.johnston@xxxxxxxxx> 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 with CREATE TABLE AS:
=# create table test as select a % 2 + 1 from generate_series(1,100) as a;
SELECT 100
-- 
Michael


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux