Search Postgresql Archives

Re: update ... set ... subquery

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




2010/3/17 John Smith <jayzee.smith@xxxxxxxxx>
guys,
trying multiple updates without success like so:

update  a
set             number = any (  select number from b where a.number=b.number)
where   number is null;
>> 'syntax error at or near "any"'

subquery returns more than one row. using 8.1.
thks, jzs


If the subquery returns multiple values, which value do you want to set to the 'number' column. For each record there can be only one value for this column? 
The subquery has to return only one value such a query.

Show the tables structure, maybe there is a better column than the 'number' to join the 'a' and 'b' tables.

regards
Szymon Guz

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux