Hi,

----- Original Message -----
From: "AJ" <[EMAIL PROTECTED]>


> > > Ver 11.15 Distrib 3.23.46, for pc-linux-gnu (i686)
> > > The problem that has cropped up I have is that in all GROUP BY column
DESC
> > > statements, the DESC is now not being recognized, and the query is being
> > > returned in ascending order.  If I use ORDER BY... DESC that works fine.
> >I'm seeing the same bug on 3.23.45 (and maybe others but I can't remember
> >all the versions I've played with recently).  It does the same thing where
> >it accepts the syntax but does not respect it (and returns rows in the
> >default ASC ordering).
>
> The problem is apparently solved if you kluge with e.g.
>          select field, count(field) from table group by field order by field
desc
> but it IS a kluge.

That wouldn't not be a kludge actually, since the SQL-99 standard does not
allow ASC/DESC on GROUP BY at all.
It is an extention in the MySQL server (see
http://www.mysql.com/doc/S/E/SELECT.html), and basically it is a shortcut for
exactly what you describe: an ORDER BY with the same fields as the earlier
GROUP BY.

I tried it too on a 3.23, and indeed it does appear to not be working.
Contrary to what is described above though, there is no ordering at all in my
output, not ascending either. So basically it is as you would expect it to be
without any ORDER BY operation. Maybe the output others got was just sheer
luck, as it depends on the order the server reads the data rows....

Anyway, I've sent a note to the developers about this, including a sample
reproducing it.


Regards,
Arjen.

--
MySQL Training Worldwide, http://www.mysql.com/training/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Arjen G. Lentz <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Technical Writer, Trainer
/_/  /_/\_, /___/\___\_\___/   Brisbane, QLD Australia
       <___/   www.mysql.com




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to