,sum(balance) over (partition by c.CUSTOMER_ID)
from customer c, account a
c.customer_id = a.customer_id
c.customer_id in (
balance < 0)
Message was edited by: chris227 sorry, didnt see that it was two tables. join added
SUM (ac.balance) OVER (PARTITION BY ac.customer_id, ac.account_id) balance,
SUM (ac.balance) OVER (PARTITION BY ac.customer_id) customer_total
FROM account ac, customer c
WHERE ac.customer_id = c.customer_id;
here below the query, you will get output exactly as required...
SUM(b.balance) OVER (PARTITION BY a.customer_id) customer_total
FROM customer a, account b
WHERE a.customer_id = b.customer_id
ORDER BY a.customer_id, b.account_id ASC.