Re: sum() problems - I don't understand

2003-06-26 Thread Jake Johnson
What is the purpose of the join? I think I know what you are trying to do so make the first query a sub query and join the subquery to the carello table. Regards, Jake Johnson [EMAIL PROTECTED] -- Plutoid - http://www.plutoid.com -

Re: sum() problems - I don't understand

2003-06-26 Thread Keith C. Ivey
On 26 Jun 2003 at 15:07, gerald_clark wrote: > The second query contains a join and may have many times more rows in > the result set. [snip] > >++-+--++--+ > >| date1 | sum1| sum2 | cod| fromprev | > >++-+--+

Re: sum() problems - I don't understand

2003-06-26 Thread gerald_clark
Why would you expect they should have the same results? The second query contains a join and may have many times more rows in the result set. PaT! wrote: Dear All, I have these two queries which are supposed to return the same results for the fields with the same name (ex query 1 sum1 = query 2

Re: sum() problems

2003-06-26 Thread Egor Egorov
"PaT!" <[EMAIL PROTECTED]> wrote: > I have this two queries > > The first one gives me the right result for the sum(): > > SELECT DATE_FORMAT(ordini.dataord,'%d-%m-%Y'), >SUM(ordini.totale), >SUM(ordini.quantita), >

RE: sum() problems

2003-06-26 Thread Andy Eastham
Pat, I think it might be caused by the fact that you are grouping by a column that isn't being selected - ordini.numordine is not in the select part. Andy > -Original Message- > From: PaT! [mailto:[EMAIL PROTECTED] > Sent: 26 June 2003 12:50 > To: [EMAIL PROTECTED] > Subject: sum() proble