ERROR: More than one tuple returned by a subselect used as an expression.

Поиск
Список
Период
Сортировка
От Mel Jamero
Тема ERROR: More than one tuple returned by a subselect used as an expression.
Дата
Msg-id 002301c2f9dc$c2047ab0$1b06a8c0@mel
обсуждение исходный текст
Ответ на call analyze from stored procedure in C  (Ulli Mueckstein <ulim@tbi.univie.ac.at>)
Ответы Re: ERROR: More than one tuple returned by a subselect used as an expression.  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-novice
help!

query is equivalent to "update table1 set field6 = (select table2_field2
from table2 where table2_field5 = table1.field5)"

table2 appears to have many instances of table2_field5.

my question is, how do i reformulate my SQL so that i can update table1 such
that it only gets the first occurrence of table2_field5 on table2 and ignore
all the other occurrences?  is there even a way where only 1 SQL statement
is sufficient to carry out the desired result(s)?

thanks in advance!!!

i hope i stated my question clearly, sorry if i didn't.

mel


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

Предыдущее
От: Ulli Mueckstein
Дата:
Сообщение: call analyze from stored procedure in C
Следующее
От: Ennio-Sr
Дата:
Сообщение: Toggling 'Expanded display on' (\x) confuses encodings