Re: insert question.. - Mailing list pgsql-general

From Dmitry Tkach
Subject Re: insert question..
Date
Msg-id 3EE74B83.6080708@openratings.com
Whole thread Raw
In response to insert question..  ("Williams, Travis L, NPONS" <tlw@att.com>)
List 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 by date:

Previous
From: Jonathan Bartlett
Date:
Subject: Re: Postgres performance comments from a MySQL user
Next
From: Justin Clift
Date:
Subject: Re: Postgres performance comments from a MySQL user