Ah. That link explains it all.  The OrderDate fields are not unique.

Thanks.

----- Original Message -----
From: "Jochem van Dieten" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, July 08, 2004 17:38 PM
Subject: Re: Query of a query inconsistancies

> Let me guess, you are using MySQL.
>
>
> In standard SQL that would not include the OrderDate column
> because each field you select without aggregating it needs to be
> in the list of fields you group by. So in standard SQL this query
> can not produce any fields other then totalcount, totalcost (both
> aggregates) and UserID (group by).
>
> For some reason in MySQL this braindead syntax is allowed, but
> even the manual says the result may be 'unpredictable', which
> appears to be exactly what you are encountering:
> http://dev.mysql.com/doc/mysql/en/GROUP-BY-hidden-fields.html
>
> It is better to stay away from non standard SQL unless you
> understand every detail of the consequences.
>
> Jochem
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to