Re: insert question..

Поиск
Список
Период
Сортировка
От Dmitry Tkach
Тема Re: insert question..
Дата
Msg-id 3EE74B83.6080708@openratings.com
обсуждение исходный текст
Ответ на insert question..  ("Williams, Travis L, NPONS" <tlw@att.com>)
Список pgsql-general
Williams, Travis L, NPONS wrote:

>I'm looking for an example on how to insert static data and information from a select at the same time..
>
>currently I'm doing:
>
>insert into performance (start,finish) select min(poll_time),max(poll_time) from poll
>
>I need to add a 3rd field that is static so I would have something like this
>
>
>insert into performance (name,start,finish) travis,select min(poll_time),max(poll_time) from poll
>
Almost :-)

The correct syntax is:

insert into performance (name,start,finish) select 'travis', min(poll_time),max(poll_time) from poll;

I hope, it helps.

Dima




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

Предыдущее
От: Jonathan Bartlett
Дата:
Сообщение: Re: Postgres performance comments from a MySQL user
Следующее
От: Justin Clift
Дата:
Сообщение: Re: Postgres performance comments from a MySQL user