Re: Insert using a subselect?

Поиск
Список
Период
Сортировка
От Francisco Reyes
Тема Re: Insert using a subselect?
Дата
Msg-id 20010911003340.W26176-100000@zoraida.natserv.net
обсуждение исходный текст
Ответ на Re: Insert using a subselect?  (Jason Tan <jason@rebel.rebel.net.au>)
Ответы Re: Insert using a subselect?  (Jason Tan <jason@rebel.rebel.net.au>)
Список pgsql-novice
On Tue, 11 Sep 2001, Jason Tan wrote:

>
> 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.

drf=# select distinct merge_date from hearn;
 merge_date
------------
 2000-11-17
 2001-07-10
 2001-09-07
(3 rows)

3 rows on 1 column.



В списке pgsql-novice по дате отправления:

Предыдущее
От: Jason Tan
Дата:
Сообщение: Re:
Следующее
От: Francisco Reyes
Дата:
Сообщение: Path for pgsql \i option?