Exactly that's the problem! how can I rewrite the query syntax avoiding the multiplication?
Thanks Patrizio -----Messaggio originale----- Da: Keith C. Ivey [mailto:[EMAIL PROTECTED] Inviato: giovedì 26 giugno 2003 22.15 A: [EMAIL PROTECTED] Oggetto: Re: sum() problems - I don't understand 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 | > >+------------+---------+------+------------+----------+ > >| 29-05-2003 | 436.498 | 10 | SC0001GP | 2666 | > >+------------+---------+------+------------+----------+ [snip] > >| date1 | sum1 | sum2 | cod | fromprev | numprev | date2 > >| > >+------------+----------+------+---------+----------+---------+------ > >+--- > >---+ > >| 29-05-2003 | 3491.984 | 80 | SC0001GP| 2666 | 2666 | > >28-05-2003 | > >+------------+----------+------+---------+----------+---------+------ In fact it appears that for this query there are 8 rows in 'carello' corresponding to each row in 'ordini', so the sums are multiplied by 8. -- Keith C. Ivey <[EMAIL PROTECTED]> Tobacco Documents Online http://tobaccodocuments.org -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]