View Single Post
Old 07-03-2009, 10:08 PM   #1 (permalink)
Leon
v7n Mentor
 
Join Date: 10-13-03
Location: Atlanta, GA
Posts: 662
iTrader: 0 / 0%
Latest Blog:
None

Leon is a glorious beacon of lightLeon is a glorious beacon of lightLeon is a glorious beacon of lightLeon is a glorious beacon of lightLeon is a glorious beacon of lightLeon is a glorious beacon of lightLeon is a glorious beacon of lightLeon is a glorious beacon of lightLeon is a glorious beacon of lightLeon is a glorious beacon of lightLeon is a glorious beacon of light
[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.
Leon is offline   Reply With Quote