I currently have a query that lookups the number of downloads for a product and it's dot releases (#.#) for the current month. Every time there is a new product and/or a new version I have to add to the query which of course is susceptible to being forgotten about especially if I'm no longer there to update it.
I setup this SQLFiddle
I have product, product_release and log tables which are pretty self explanatory, the log table logs when someone downloads a product release. product_release are the releases of the product.
So my question is there a better way to do this? I'm sure since I am naming the fields that the current query would have to be thrown away and done in a different manner. I'm not opposed to it, I could have the server side language process the query in a dynamic fashion too. I'm wanting to have a query that I don't have to manage, server side processing to be optional and avoided if possible.