select last_name,first _name,d.account _number,i.card_ number
case sum(transaction _amount)
WHEN transaction_typ e ='D' THEN transaction_amo unt < 0
Else
transaction_typ e ='C' THEN transaction_amo unt > 0
END AS Total
from imp_person join imp_account d on person_id = person_id
JOIN imp_transaction i on d.account_numbe r = i.account_numbe r
Group by last_name,accou nt_number,card_ number
...
User Profile
Collapse
-
case statements in oracle
1.List the card holder’s name, account number, card number, and the total value of all transactions against each card. Remember that if the transaction type is a ‘D’, the transaction amount will be a negative value; if the transaction type is a ‘C’, the transaction amount will be a positive value. Order the output on the person’s last name, then by account and card number.
select last_name,first _name,d.account _number,i.card_ number,...
No activity results to display
Show More
Leave a comment: