You should restrucutre your table to be normalized. If you only ever had one product, you could keep reservation, product and quantity in the same table. But since you have one or more items per reservation, they should go into its own table
table reservations
--------------------
id
quantity
table product
--------------------
id
name
price
etc
reservation_products
------------------------
reservation_id
product_id
quantity
PRMARY KEY (reservation_id, product_id)
This way, it doesn't matter if a reservation contains one item or several. You always retrieve item(s) and their quantities in each reservation by
SELECT r.id p.id, p.name, r.quantity*rp.quantity AS reservation_quantity
FROM reservation AS r
INNER JOIN reservation_products AS rp ON r.id = rp.reservation_id
INNER JOIN product AS p ON rp.product_id = p.id
ORDER BY quantity DESC
And to get the sum over several reservations, drop the reservation ids and group on product id and name
SELECT p.id, p.name, SUM(r.quantity*rp.quantity) AS total_quantity
FROM reservation AS r
INNER JOIN reservation_products AS rp ON r.id = rp.reservation_id
INNER JOIN product AS p ON rp.product_id = p.id
GROUP BY p.id, p.name
ORDER BY quantity DESC
As for the difference between WHERE and HAVING, the WHERE clause is used to actually retrieve rows, which means that any information used in the where clause has to be present before the query is executed. Some things aren't, such as SUMs etc, which means they can't be used in this case.
HAVING on the other hand has no effect of the number of rows retrieved from the database, but it does have an effect of what is presented in the result by filtering anything that doesn't match.
It's like asking someone to fetch blue balls from a dark room filled with different colored balls and cubes. You can tell them to SELECT balls FROM room WHERE shape='round' HAVING color='blue'. While performing the query (fetching the items), the shape is used to limit the number of retrieved items, but the color is not known until after the query has finished and the balls are brought out into the light, and as such they have to be discarded after everything is retrieved.
And to make an example referring to your data, you could use WHERE p.id = 100 (to only retrieve, and thus count, product with id 100) or HAVING quantity < 5 to discard all retrieved data where there were more than 5 items in total of a given product.
This means that you can always move things from the WHERE clause to the HAVING clause, but not always move things from the HAVING clause to the WHERE clause. However, just because you can doesn't mean you should. Anything in the HAVING clause that can go in the WHERE clause means that you suffer a performance hit.