Subject join aggregate query to table
Author msarossy
i need some help with the sql to join an aggregate function to another
table.

the aggregate query :

select sales.sales_id, sum(payments.allocated_amount)
from sales join payments
on sales.sales_id = payments.sales_id
group by sales_id

and then this needs to be joined by customer.customer_id to
sales.customer_id

your help is appreciated

marko