Skip to content

Instantly share code, notes, and snippets.

@mgreenly
Created August 1, 2025 12:51
Show Gist options
  • Select an option

  • Save mgreenly/5660580b9c52e42c17da98bda0051853 to your computer and use it in GitHub Desktop.

Select an option

Save mgreenly/5660580b9c52e42c17da98bda0051853 to your computer and use it in GitHub Desktop.
events
SELECT
e1.event_id,
e1.created_at
FROM
events e1
JOIN
events e2 ON e1.event_id <> e2.event_id
AND e1.created_at BETWEEN e2.created_at - INTERVAL '10' MINUTE AND e2.created_at + INTERVAL '10' MINUTE;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment