On Tue, Apr 22, 2008 at 01:17:42PM -0300, Leandro Casadei wrote:
> Hi, I need to update a field from a table based in a count.
>
> This is the query:
I don't know why your given query doesn't work, but you could simplify
it which may help.
> update shops
> set itemsqty =
> (
> select count(*)
> from items i1
> where i1.shopid = s0.shopid
> )
> from shops s0
Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.