ORDER BY problem
am 23.07.2002 15:30:33 von merlin
Hi,
there is an issue with the ORDER BY clause in SELECT statement:
How-To-Repeat:
SELECT * FROM sometable ORDER BY somethingnotafield;
This return correctly this error:
ERROR 1054: Unknown column 'somethingnotafield' in 'order clause'
But if you quote (single or double) the somethingnotafield, then the SELECT
runs and returns the list in natural order (looks like at least):
SELECT * FROM sometable ORDER BY "somethingnotafield";
The MySQL version I'm running is 3.23.43, but i didn't found any changelog
about ORDER BY posterior to this one.
That's all. Sorry if this was already corrected. And please let me know if
this is supost to run this way!
--
Merlin, the Mage
themage.camelot.co.pt
------------------------------------------------------------ ---------
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 bugs-thread12214@lists.mysql.com
To unsubscribe, e-mail
Re: ORDER BY problem
am 23.07.2002 18:00:09 von Peter Zaitsev
On Tuesday 23 July 2002 17:30, Merlin, The Mage wrote:
>
> =09SELECT * FROM sometable ORDER BY "somethingnotafield";
>
> =09The MySQL version I'm running is 3.23.43, but i didn't found any cha=
ngelog
> about ORDER BY posterior to this one.
>
> =09That's all. Sorry if this was already corrected. And please let me k=
now if
> this is supost to run this way!
I've checked this with recent 4.0.3 tree:
=20
mysql> select user from user order by lower(user);
+------+
| user |
+------+
| |
| |
| root |
| root |
+------+
4 rows in set (0.00 sec)
So it seems to work now. But Unfortunately I can't tell if your bug repo=
rt is=20
not valid as you have not submitted your case the way it could be exactly=
=20
tested
Please create one which could be checked just by
mysql test < test.sql
so we could check exactly the same case as you're doing. =20
=20
--=20
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Peter Zaitsev
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Moscow, Russia
<___/ www.mysql.com M: +7 095 725 4955
------------------------------------------------------------ ---------
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 bugs-thread12216@lists.mysql.com
To unsubscribe, e-mail
Re: ORDER BY problem
am 23.07.2002 19:59:07 von Sinisa Milivojevic
Merlin, The Mage writes:
> Hi,
>
> there is an issue with the ORDER BY clause in SELECT statement:
>
> How-To-Repeat:
>
> SELECT * FROM sometable ORDER BY somethingnotafield;
>
> This return correctly this error:
>
> ERROR 1054: Unknown column 'somethingnotafield' in 'order clause'
>
>
> But if you quote (single or double) the somethingnotafield, then the SELECT
> runs and returns the list in natural order (looks like at least):
>
> SELECT * FROM sometable ORDER BY "somethingnotafield";
>
> The MySQL version I'm running is 3.23.43, but i didn't found any changelog
> about ORDER BY posterior to this one.
>
> That's all. Sorry if this was already corrected. And please let me know if
> this is supost to run this way!
>
> --
> Merlin, the Mage
> themage.camelot.co.pt
Hi!
This is expected behaviour as then "some_constant" becomes a hidden
constant column.
--
Regards,
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ 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 bugs-thread12218@lists.mysql.com
To unsubscribe, e-mail
Re: ORDER BY problem
am 24.07.2002 03:05:12 von merlin
On Tuesday 23 July 2002 06:59 pm, Sinisa Milivojevic wrote:
> Merlin, The Mage writes:
> > Hi,
> >
> > there is an issue with the ORDER BY clause in SELECT statement:
> >
> > How-To-Repeat:
> > (...)
>
> Hi!
>
> This is expected behaviour as then "some_constant" becomes a hidden
> constant column.
Ok ppl,
Thank you all. I already got it.
It really did confused me, and make me think that was an error because even
if the field_name as quoted it was allways the field_name, so I expected
that quoted uncorrect field_name remained uncorrect field_name and didn't
remembered order by some_func() for example.
It's even better for the propose that got me here!
--
Merlin, the Mage
themage.camelot.co.pt
------------------------------------------------------------ ---------
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 bugs-thread12221@lists.mysql.com
To unsubscribe, e-mail