Order by str to int

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi jave a database and I want to oder my result by a colum containing
string bit order them like they where int

ex Select * form members order by level

level is string containing data like '12'

I want to oder like the level is Int 12 and not string '12'


Re: Order by str to int

Alex C wrote:
Quoted text here. Click to load it

Try using:  ORDER BY level+0

That should force it to be interpreted in an integer context.

Bill K.

Re: Order by str to int


Working like a charm

Site Timeline