|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Andy Shellam (andy-lists
networkmail.eu)
Date: Thu Dec 04 2008 - 17:10:02 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Nishi,
I think what's more relevant is why did you downgrade to 5.0.22? The
sorting issue you're experiencing was fixed for the 5.0.67 community
release. Many bugs will have been fixed between 5.0.22 and 5.0.51a;
downgrading is not a solution. Upgrade. If this is a new system you
could even consider going to 5.1.30.
Andy
Nishikant Kapoor wrote:
> Its been a while since I posted this. Would like to check again with the
> folks on this list if they know why the results of query (b) are all
> blank on MySQL 5.0.22. It works fine with 5.0.51a. If it is a bug in
> 5.0.22, can someone suggest a workaround for this (other than upgrading
> MySQL).
>
> Thanks,
> Nishi
>
> CREATE TABLE t ( id TINYINT, title VARCHAR(10) );
> INSERT INTO t (id, title) VALUES (1, 'aaa'), (2, 'bbb'), (3, 'ccc'), (4,
> 'ddd'), (5, 'eee');
>
> (a) DO
sn := 0; SELECT
sn:=
sn+1 sn, id, title FROM t GROUP BY id
> ORDER BY id desc;
> | sn | id | title |
> +------+------+-------+
> | 1 | 5 | eee |
> | 2 | 4 | ddd |
> | 3 | 3 | ccc |
> | 4 | 2 | bbb |
> | 5 | 1 | aaa |
>
> (b) [MySQL 5.0.51a]: DO
sn := 0; SELECT
sn:=
sn+1 sn, id, title FROM t
> HAVING sn=2 ORDER BY id desc;
> +------+------+-------+
> | sn | id | title |
> +------+------+-------+
> | 3 | 4 | ddd |
> +------+------+-------+
> 1 row in set (0.00 sec)
>
> (b) [MySQL 5.0.22]:
> mysql> DO
sn := 0; SELECT
sn:=
sn+1 sn, id, title FROM t HAVING sn=2
> ORDER BY id desc;
> Query OK, 0 rows affected (0.00 sec)
>
> Empty set (0.00 sec)
>
>
>
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]