Re: insert question..

From: Dmitry Tkach <dmitry(at)openratings(dot)com>
To: "Williams, Travis L, NPONS" <tlw(at)att(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: insert question..
Date: 2003-06-11 15:32:19
Message-ID: 3EE74B83.6080708@openratings.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Justin Clift 2003-06-11 15:39:42 Re: Postgres performance comments from a MySQL user
Previous Message Dmitry Tkach 2003-06-11 15:29:59 Re: Performance of query (fwd)