List:General Discussion« Previous MessageNext Message »
From:Matt W Date:November 28 2003 12:03am
Subject:Re: Disorder result with ORDER BY with ENUM, INT
View as plain text  
Hi,

----- Original Message -----
From: "Chuck Gadd"
Sent: Wednesday, November 26, 2003 2:29 PM
Subject: Re: Disorder result with ORDER BY with ENUM, INT


> Kriengkrai J. wrote:
>
>  > -- System: MySQL 4.0.13, 4.0.16 on Linux x86
>  > -- Table type: MyISAM, InnoDB
>  > -- Description / How-To-Repeat:
>  > -- 1. When I use
>  > -- SELECT id, type FROM test.report ORDER BY type, id;
>  > -- the result is in wrong order
>  > -- --
>  > -- +----+---------+
>  > -- | id | type    |
>  > -- +----+---------+
>  > -- |  4 | general |
>  > -- |  3 | general |
>  > -- |  1 | general |
>  > -- |  2 | general |
>  > -- |  5 | inhouse |
>  > -- |  6 | inhouse |
>  > -- ..
>
> It is sorted EXACTLY as you specified.  First by type, and then by ID.

It doesn't look sorted to me ("general"s aren't sorted by id). :-)
Shouldn't this be the order?

+----+---------+
| id | type    |
+----+---------+
|  1 | general |
|  2 | general |
|  3 | general |
|  4 | general |
|  5 | inhouse |
|  6 | inhouse |


Matt

Thread
Disorder result with ORDER BY with ENUM, INTKriengkrai J.26 Nov
  • RE: Disorder result with ORDER BY with ENUM, INTTheMechE26 Nov
  • Re: Disorder result with ORDER BY with ENUM, INTChuck Gadd26 Nov
  • Re: Disorder result with ORDER BY with ENUM, INTMatt W28 Nov