Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

Mysql Case sum

select sum(CASE WHEN payment_status = 'PAID' THEN paid_amount else 0 end) as paid,
       sum(CASE WHEN payment_status = 'Not Paid' THEN total_amount_due else 0 end) as due
from monthly_fee
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Mysql #Case #sum
ADD COMMENT
Topic
Name
1+1 =