Count rows seen so far.
Section: Running metrics
Running count
sql
sql
SELECT event_time,
user_id,
COUNT(*) OVER (
ORDER BY event_time
ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) AS running_events
FROM events;Explanation
Helpful for event streams and operational dashboards.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Running metrics