to reference this again http://stackoverflow.com/questions/501347/sql-products-productsales
how could i do something like that when the primary key is made up of two columns and not one?
so products has two columns as PK, and productsales has two columns as FK.
here is the solution with a 1-column key:
SELECT p.[name]
FROM products p
WHERE p.product_id in (SELECT s.product_id
FROM productsales s
WHERE s.[date] between @dateStart and @dateEnd
GROUP BY s.product_id
HAVING Sum(s.quantity) > @X )