'Calculating the average for the number of records in the table
I am read the number of orders sorted by day of the week from the database.
SELECT
COUNT(`ID`),
DAYNAME(`WorkingDay`) AS Day_name
FROM status
WHERE
NameFinish = "Employer1"
GROUP BY Day_name
ORDER BY (
CASE DAYOFWEEK(`WorkingDay`)
WHEN 1 THEN 5 ELSE DAYOFWEEK(`WorkingDay`)
END);
i Get the result:
COUNT(`ID`) Day_name
83 Monday
79 Tuesday
81 Wednesday
76 Thursday
77 Friday
9 Saturday
How can I now calculate the average of all Count IDs with regard to the amount of days in the "Day_name" column?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
