Re: Insert using a subselect?

From: A_Schnabel(at)t-online(dot)de (Andre Schnabel)
To: "Pgsql Novice" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Insert using a subselect?
Date: 2001-09-13 18:25:24
Message-ID: 001a01c13c81$74f14060$0201a8c0@aschnabel.homeip.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

----- Original Message -----
From: "Francisco Reyes" <lists(at)natserv(dot)com>
Subject: Re: [NOVICE] Insert using a subselect?

>
> so it is not possible to populate an insert from a subselect if there is
> more than one row/column?

Of course, it is.
But you should just either use he keyword "values" or use a select.

The right statement is:
insert into hearn_dates (date)
select distinct merge_date from hearn;

For further details have a look at the iDoc's
http://www.postgresql.org/idocs/index.php?sql-insert.html

Andre

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Sykora, Dale 2001-09-14 00:33:27 [novice] pg_regress.sh problem
Previous Message Francisco Reyes 2001-09-13 17:27:52 Re: Path for pgsql \i option?