This is the Query
CASE SF.value
WHEN '' THEN '9999999999'
WHEN 'N/A' THEN '99999999'
WHEN 'POA' THEN '999999999'
WHEN 'Free' THEN -1
ELSE IF(SF.value IS NULL,'9999999999',CAST(SF.value as DECIMAL))
END as priceval,
///End Query
I have value in DB as
value(varchar)
4
4.5
4.3
6.6
after fetching from DB,
PRINTING:
var_dump($data);
Output
---------
string(1) "4"
string(1) "5"
string(1) "5"
string(1) "7"
I Need get value in following order BY integer or Float or Decimal But value in order by
string(1) "4"
string(3) "4.3"
string(3) "4.5"
string(3) "6.6"
(OR)
int(1) "4"
int(3) "4.3"
int(3) "4.5"
int(3) "6.6"
You’re using
DECIMALwithout specifying precision, tryCAST(SF.value AS DECIMAL(10,1))