Re: [GENERAL] Updating with a subselect

2008-04-23 Thread Leandro Casadei
On Wed, Apr 23, 2008 at 10:59 AM, Stephan Szabo < [EMAIL PROTECTED]> wrote: > On Tue, 22 Apr 2008, Leandro Casadei wrote: > > > Hi, I need to update a field from a table based in a count. > > > > This is the query: > > > > > > updateshops > > setitemsqty = > > ( > > select coun

Re: [GENERAL] Updating with a subselect

2008-04-23 Thread Stephan Szabo
On Wed, 23 Apr 2008, Leandro Casadei wrote: > On Wed, Apr 23, 2008 at 10:59 AM, Stephan Szabo < > [EMAIL PROTECTED]> wrote: > > > On Tue, 22 Apr 2008, Leandro Casadei wrote: > > > > > Hi, I need to update a field from a table based in a count. > > > > > > This is the query: > > > > > > > > > upda

Re: [GENERAL] Updating with a subselect

2008-04-23 Thread Stephan Szabo
On Tue, 22 Apr 2008, Leandro Casadei wrote: > Hi, I need to update a field from a table based in a count. > > This is the query: > > > updateshops > setitemsqty = > ( > select count(*) > from items i1 > join shops s1 on i1.shopid = s1.shopid > where s1.sh

Re: [GENERAL] Updating with a subselect

2008-04-23 Thread Martijn van Oosterhout
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. > updateshops > setitemsqty = > ( > sele

Re: [GENERAL] Updating with a subselect

2008-04-23 Thread A. Kretschmer
am Tue, dem 22.04.2008, um 13:17:42 -0300 mailte Leandro Casadei folgendes: > Hi, I need to update a field from a table based in a count. > > This is the query: > > > updateshops > setitemsqty = > ( > select count(*) > from items i1 > join shops s1 on i1.sho

[GENERAL] Updating with a subselect

2008-04-23 Thread Leandro Casadei
Hi, I need to update a field from a table based in a count. This is the query: updateshops setitemsqty = ( select count(*) from items i1 join shops s1 on i1.shopid = s1.shopid where s1.shopid = s0.shopid ) from shops s0 The problem I'm having