sorting problem

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
mays
Forum Newbie
Posts: 3
Joined: Wed Jul 10, 2002 5:45 am

sorting problem

Post by mays »

the following sql query doesnt work as i expect. i am trying to sort the records order by pprice (i want it treated as integer) but it sort them as if they were char values.

SELECT fiyat,
@ham:=(fiyat & 0x0FFFFFFF),
@cur:=(fiyat >> 28 ),
if((@cur=1),(@ham),(if((@cur=2),(@ham*$dolr_val/100),(@ham*$euro_val/100)))) as pprice
from tbl1 order by pprice;

fiyat is a field 4bytes integer first 4 bits used for currency info then the rest 28bits used for price.

thanks for all people interested.
Post Reply