|
[MySQL] Order By Issue
Sup Folks.
I have a problem with ORDER BY and numbers + characters. I have strings in my database that look like this: "$75.00 or XYZ for $300.00" and most of the strings look more like "$125", "$235" etc. well when you order by the field by say DESC it does this:
"$75.00 or XYZ for $300.00"
"$235"
"$125"
When what I really want is:
"$235"
"$125"
"$75.0 or XYZ for $300.00"
Someone suggested that I do "ORDER BY string+0" and that gives a great result if you just want "ASC" but I want to have the ability to do both ASC and DESC. I can't make the type a INT either because they want to be able to put normal characters in the string.
|