Page 1 of 1

sorting problem

Posted: Wed Jul 10, 2002 5:45 am
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.