Re: Insert using a subselect? - Mailing list pgsql-novice

From Jason Tan
Subject Re: Insert using a subselect?
Date
Msg-id Pine.LNX.3.95.1010911124729.27217A-100000@rebel.rebel.net.au
Whole thread Raw
In response to Insert using a subselect?  (Francisco Reyes <lists@natserv.com>)
Responses Re: Insert using a subselect?
List pgsql-novice
On Mon, 10 Sep 2001, Francisco Reyes wrote:

> Does PostgreSQL supports doing an insert with a subselect as it's value?
> Something like:
>
> insert into hearn_dates (date)
> values ((select distinct merge_date from hearn));
>
> The error I am getting is:
> ERROR:  More than one tuple returned by a subselect used as an expression.
>

Presumably you slect distinct is returing more than one value/tuple.

Run it by hand and see what it returns.


Jason


pgsql-novice by date:

Previous
From: Francisco Reyes
Date:
Subject: Insert using a subselect?
Next
From: Jason Tan
Date:
Subject: Re: