Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Days of Week with Total

8 views
Skip to first unread message

Russ Hromyko

unread,
Oct 12, 2023, 4:10:51 AM10/12/23
to
Here is my query:

(SELECT DayName(startdate), COUNT(1)
FROM reservations
WHERE MONTH(startdate) = 09 AND YEAR(startdate) = 2023
GROUP BY DayName(startdate)
ORDER BY DAYOFWEEK(startdate))
UNION ALL
SELECT 'Total' widgets, COUNT(1)
FROM reservations

The output is:

Friday 14
Saturday 6
Sunday 3
Thursday 6
Tuesday 1
Monday 5
Wednesday 2
Total 37

How do I make the output Sunday through Saturday with Total?

Sunday 3
Monday 5
Tuesday 1
Wednesday 2
Thursday 6
Friday 14
Saturday 6
Total 37
0 new messages