数据库中varchar型数据比较
数据库中,我把一个金额(PFunds)字段设置成了varchar,我现在想来选择
select pid,PName,PFunds
from HS_Investment
where PFunds<100 and PFunds>10
PFunds可能有小数,比如说 56.58;
如果我不想改数据库字段的话,怎么实现
------解决方案--------------------
SQL code
select pid,PName,PFunds
from HS_Investment
where cast(PFunds as varchar)<100 and cast(PFunds as varchar)>10
------解决方案--------------------