At 06:49 AM 1/23/2004, Sagar C Nannapaneni wrote:
>Hi all,
>
>I have an ID field in my database...it reads like this
>
>ASS1
>ASS23
>ASS4
>ASS10
>ASS6
>.
>.
>.
>
>when i'm retrieving the data by taking ORDER BY clause it is sorting like this
>
>ASS1
>ASS10
>ASS23
>ASS4
>ASS6
>
>means its only sorting by the 4 the character. i want the sorting to be
>done like the following
>
>ASS1
>ASS4
>ASS6
>ASS10
>ASS23
>
>Solutions are greatly appreciated
Sagar,
You can also try:
select * from table order by cast(substr(id,4) as unsigned)
Mike