db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Hillegas <rick.hille...@oracle.com>
Subject Re: Porting to standard SQL
Date Mon, 06 Feb 2012 16:35:39 GMT
On 2/6/12 7:43 AM, TXVanguard wrote:
>
> Bryan Pendleton-3 wrote:
>>
>> Perhaps something like:
>>
>>     update t2 set b = (select b from t1 where t1.a = t2.a)
>>
>>
> I tried your suggestion, but now I get the error message:
>
>      "Scalar subquery is only allowed to return a single row."
>
> Any other suggestions?
This means that more than 1 row is returned by the subquery. That, in 
turn, suggests that the query, which succeeds for you on another 
database, may not be behaving in a predictable way there. Since more 
than one row qualifies to drive the update, which row do you want? Is 
there some other restriction which you can put in the subquery to 
guarantee that you get one, predictable row?

Hope this helps,
-Rick

Mime
View raw message