Will Seitz wrote:
>
> Hi,
> I am probably missing something obvious in the documentation, but how do I
> convert a string to an integer in mysql. I am sorting on a substring
> (String-Number) and want the substring sorted as an integer and not a string.
>
> database, sql, query
>
> Thanks,
> -Will Seitz
>
> ---------------------------------------------------------------------
select substring(strnumb,5)+0 as subnum from mytable order by subnum;
---------------------------------------------------------------------
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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php