Ariel,

You can try this:

mysql>select stri from prueba order by stri+0 desc;

Leo Huang



2006/2/17, Ariel Sánchez Mora <[EMAIL PROTECTED]>:
>
> mysql> describe prueba;
> +-------+---------+------+-----+---------+-------+
> | Field | Type    | Null | Key | Default | Extra |
> +-------+---------+------+-----+---------+-------+
> | inte  | int(2)  | YES  |     | NULL    |       |
> | stri  | char(2) | YES  |     | NULL    |       |
> +-------+---------+------+-----+---------+-------+
> 2 rows in set (0.00 sec)
>
> mysql> select * from prueba;
> +------+------+
> | inte | stri |
> +------+------+
> |    1 | 1    |
> |    2 | 2    |
> |    3 | 3    |
> |    4 | 4    |
> |    5 | 5    |
> |    6 | 6    |
> |    7 | 7    |
> |    8 | 8    |
> |    9 | 9    |
> |   10 | 10   |
> +------+------+
> 10 rows in set (0.00 sec)
>
> -->    Is there a way I can make this:
>
> mysql> select stri from prueba order by stri desc;
> +------+
> | stri |
> +------+
> | 9    |
> | 8    |
> | 7    |
> | 6    |
> | 5    |
> | 4    |
> | 3    |
> | 2    |
> | 10   |
> | 1    |
> +------+
> 10 rows in set (0.00 sec)
>
> -->    come out like this:
>
> mysql> select inte from prueba order by inte desc;
> +------+
> | inte |
> +------+
> |   10 |
> |    9 |
> |    8 |
> |    7 |
> |    6 |
> |    5 |
> |    4 |
> |    3 |
> |    2 |
> |    1 |
> +------+
> 10 rows in set (0.00 sec)
>
> I'm using MySQL 4.1.14 in windows 2000.
>
> Thanks!
>
> Ariel
>
>

Reply via email to