Subject | join aggregate query to table |
---|---|
Author | msarossy |
Post date | 2005-11-08T07:49:07Z |
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
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