0

i have a query is to lookup CREDIT_CARD table using CREDIT_CARD_ID and get the MIN_REPAY_AMT. if SUM(AMOUNT_DEPOSITED) < MIN_REPAY_AMT for that month Then populate 1000 else 0 i have attempted the query below kindly help me out

and i am getting the following error.
Error:

ERROR at line 2:
ORA-00923: FROM keyword not found where expected

Code:

select a.CREDIT_CARD_ID,a.MIN_REPAY_AMT,to_char(DATE_OF_TRANS,'month') 
case when
a.CREDIT_CARD_ID = b.CREDIT_CARD_ID
then
case when
sum(CREDIT_CARD_DEPOSIT.AMOUNT_DEPOSITED)< a.MIN_REPAY_AMT
Then
1000
else
0 
end repay_charges from credit_card a join  CREDIT_CARD_WITHDRAW b on a.CREDIT_CARD_ID = b.CREDIT_CARD_ID;
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by hfx642
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.