Skip site navigation (1) Skip section navigation (2)

Re: Insert using a subselect?

From: Jason Tan <jason(at)rebel(dot)rebel(dot)net(dot)au>
To: Francisco Reyes <lists(at)natserv(dot)com>
Cc: Pgsql Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Insert using a subselect?
Date: 2001-09-11 03:18:07
Message-ID: (view raw or whole thread)
Lists: 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.


In response to


pgsql-novice by date

Next:From: Jason TanDate: 2001-09-11 03:19:25
Subject: Re:
Previous:From: Francisco ReyesDate: 2001-09-10 21:19:52
Subject: Insert using a subselect?

Privacy Policy | About PostgreSQL
Copyright © 1996-2015 The PostgreSQL Global Development Group