We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 12a1848 commit b6cd6a5Copy full SHA for b6cd6a5
MySQL/server-utilization-time.sql
@@ -6,7 +6,7 @@ WITH diff_cte AS (
6
SELECT TIMESTAMPDIFF(SECOND, status_time, (LEAD(status_time) OVER w)) AS diff,
7
session_status
8
FROM servers
9
- WINDOW w AS (PARTITION BY server_id ORDER BY status_time, session_status)
+ WINDOW w AS (PARTITION BY server_id ORDER BY status_time)
10
)
11
12
SELECT FLOOR(SUM(diff) / 86400) AS total_uptime_days
0 commit comments