Re: How to create a specific table

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: How to create a specific table
Дата
Msg-id CAB7nPqRw38Tns+25ghXuPEmNKSwWuV4dZoaRkW95ORdxtZRW8w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to create a specific table  (David G Johnston <david.g.johnston@gmail.com>)
Список pgsql-general
On Thu, Jan 22, 2015 at 11:59 PM, David G Johnston
<david.g.johnston@gmail.com> 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


В списке pgsql-general по дате отправления:

Предыдущее
От: Andrey Lizenko
Дата:
Сообщение: Re: temporary tables are logged somehow?
Следующее
От: Pierre Hsieh
Дата:
Сообщение: how to calculate standard deviation from a table