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 unde
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 -
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 |
> >++-+--+
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
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 sum1):
The first query gives me back the correct result for the sum():
SELECT DATE_FORMAT(ordini.dataord,'%d-%m-%Y') date1,
"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),
>
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 PROTECTE
Dear All,
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),
ordini.codcliente,