[ciapug] MySQL table data - "1" and "01" different values
Ryan O'Rourke
ciapug@cialug.org
06 Apr 2004 12:02:53 -0500
On Tue, 2004-04-06 at 11:27, Lathrop Preston wrote:
> ok based on what Champ dug up.
>
> this should work (store car_num as VARCHAR(3))
>
> SELECT car_num, CAST(car_num AS INT) AS cn_int, [any other fields] FROM
> the_table [WHERE whatever] ORDER BY cn_int
Apparently CAST was introduced into MySQL 4.0.2 - unfortunately my
webhost is using 3.23.58.
I'd like to know if this works or not. Can anyone test this method and
report back?