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

From: "Mel Jamero" <mel(at)gmanmi(dot)tv>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: ERROR: More than one tuple returned by a subselect used as an expression.
Date: 2003-04-03 12:30:05
Message-ID: 002301c2f9dc$c2047ab0$1b06a8c0@mel
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message John D. Tiedeman 2003-04-03 15:52:33 Kylix-PGSQL connection problem
Previous Message Ulli Mueckstein 2003-04-03 11:31:18 call analyze from stored procedure in C