0
Staff I need to calculate the monthly consumption of the licenses used here in the company I work.
I have a table with the product (dbo. Product), the number of licenses installed on the server (dbo. License) the date the product was installed (dbo.Firstdate) and the date of uninstallation (dbo.Decomdate), when the product is still installed the uninstall date has the NULL value.
Example table available on sqlfiddle
I would like to know how to add up the consumption of licenses by grouping by month and by product in the last 12 months.
Ex.:
Date | Product | Totallicense
2017-08 | Adobe Photoshop | 8
2017-08 | Coreldraw | 5
2017-09 |...
2018-07 | Adobe Photoshop | 4
2018-07 | Coreldraw | 2
Example table available on sqlfiddle
If any of the answers solved your problem, please mark it as accepted!
– Matheus Ribeiro