BiggerBrother
Technical User
I need to join these two statements, so that I can take one value from the other?
Basically, I need to get sum(sale_quantity) - COUNT(*), how do I link these two statements, and only return the one value in this statement?
Many thanks
BB
Code:
select sum(sale_quantity)
FROM
AS_customers, AS_sales
WHERE
cus_id=sale_cus_id AND
cus_id=1 AND
sale_prod_id=1
SELECT COUNT(*)
FROM AS_collection, AS_customers
WHERE
col_cus_id = cus_id AND
cus_id=1 AND
col_prod_id = 1
Basically, I need to get sum(sale_quantity) - COUNT(*), how do I link these two statements, and only return the one value in this statement?
Many thanks
BB