دستور باحال
following the idea:
select (amount1 * case amount1paidstatus when 'yes' then 1 else 0 end) + (amount2 * case amount2paidstatus when 'yes' then 1 else 0 end)
from my table
where (day=1) and (customer=1)
+ نوشته شده در سه شنبه بیست و هفتم دی ۱۳۹۰ ساعت 20:21 توسط احمد داس زرین
|