treat mysql longtext as integer in query

Posted by InnateDev on Stack Overflow See other posts from Stack Overflow or by InnateDev
Published on 2010-05-26T09:42:41Z Indexed on 2010/05/26 9:51 UTC
Read the original article Hit count: 237

Filed under:

I have a set field in my db that is longtext. I have used prices in this field and cannot change the field type to integer. In my query however I need to sort by these fields and assume I should treat them as an integer. is there another way to query these results to sort by price as an integer and not longtext without having to change the field type? at the moment 3900000 is smaller than 4300 in my result set.

© Stack Overflow or respective owner

Related posts about mysql