J
James B
I asked a similiar question before but it had a INNER
JOIN and the answer given was specific to the JOIN, now
this query doens't have a JOIN and its doing the same
thing
SELECT ProductId, SUM(count) as sum_count
FROM Sales
WHERE date BETWEEN #start# AND #end#
GROUP BY ProductId
For example if product ids 1-10 exist in the data and if
no sales for product id 3 exists from start to end then
the query won't return a record with product id = 3 and
sum_count = 0, it simply leaves it out.
How can I get this query to return all Product Ids which
exist in the data, even if they don't have Sales between
start and end?
JOIN and the answer given was specific to the JOIN, now
this query doens't have a JOIN and its doing the same
thing
SELECT ProductId, SUM(count) as sum_count
FROM Sales
WHERE date BETWEEN #start# AND #end#
GROUP BY ProductId
For example if product ids 1-10 exist in the data and if
no sales for product id 3 exists from start to end then
the query won't return a record with product id = 3 and
sum_count = 0, it simply leaves it out.
How can I get this query to return all Product Ids which
exist in the data, even if they don't have Sales between
start and end?