select (sum(case pdapaytype when 1 then pdaaccount_price else 0 end)- sum(pdaaccount_priceback)) as cash
from pdaaccount 我想得出cash的值如果为空,为默认为0.00,非空的话格式化为两位小数,谢谢!
from pdaaccount 我想得出cash的值如果为空,为默认为0.00,非空的话格式化为两位小数,谢谢!
from pdaaccount
cast((sum(case pdapaytype when 1 then pdaaccount_price else 0 end)- isnull(sum(pdaaccount_priceback),0)) as dec(18,2)) as cash
from pdaaccount
select convert(decimal(20, 2), isnull((sum(case pdapaytype when 1 then pdaaccount_price else 0 end)- sum(pdaaccount_priceback)),0)) as cash
from pdaaccount
from pdaaccount