I am working with a charting program to show monthly inventory totals. So far I only have data for May (the June data will be inserted into the table automatically on June 1st and timestamped).
I am using the below query, and it returns 1 row showing 375 devices for the month of May like this:
devices created_month
------- -------------
375 5/1/2012
Is this query set up properly so that on June 1st if I have 380 devices I will receive the following output?
devices created_month
------- -------------
375 5/1/2012
380 6/1/2012
I'd just like to confirm that I am interpreting this query properly.
SELECT count(device_type) as devices, description, ip_address, user_tag,
DATE_FORMAT(LAST_UPDATE,"%Y-%m") as created_month
FROM ahrq_inventory_internal
GROUP BY created_month