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