Create a single query to give me some statistics from a mysql table
€12-18 EUR / год.
I have a table, "documents", which is continuesly filled with data. The field "in_date" is a datetime-field.
I need the following:
How many documents are in the table from this week, grouped by [login to view URL]
How many documents are in the table from last week, grouped by [login to view URL]
I can see the number of documents this week by doing this query:
SELECT COUNT(md5sum) AS c, myndighet FROM `document` WHERE YEARWEEK(in_date) = YEARWEEK(CURRENT_DATE) GROUP BY myndighet
But in the same query I also need a COUNT of how many documents where in from last week.
Very important that it's done in one query only.
A sample .sql file is provided.
ID Проекту: #7676608
Про проект
Доручено:
Hello, I can write this query up really quickly. Please let me know when we can discuss. Thanks you.