I have a table FEES.
It has columns like fee_id, return_code,fee_source , application_fee, approval_fee and denial_fee
I need to create a stored procedure that will get SUM of application_fee and SUM of approval or denial fee(see logic below) .
The trick here is to get the right field based on following logic:
If return_code = 0 AND fee_source =1 I need to have an approval_fee in SELECT clause
If return_code <> 0 AND fee_source =1 I need to have an denial_fee in SELECT clause
Thanks for your help
It has columns like fee_id, return_code,fee_source , application_fee, approval_fee and denial_fee
I need to create a stored procedure that will get SUM of application_fee and SUM of approval or denial fee(see logic below) .
The trick here is to get the right field based on following logic:
If return_code = 0 AND fee_source =1 I need to have an approval_fee in SELECT clause
If return_code <> 0 AND fee_source =1 I need to have an denial_fee in SELECT clause
Thanks for your help