hard20 pts · first answer countswindow-functionssqlgaps-and-islands
Runs of the same machine status
Statuses by minute are UP, UP, DOWN, DOWN, UP. You compute ROW_NUMBER() OVER (ORDER BY ts) - ROW_NUMBER() OVER (PARTITION BY status ORDER BY ts). What does grouping by status and this difference give?
Discussion 0
Join free to post in the discussion.