Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hemantachhami19/7445f187923ef0cc60e7c0de56219fe0 to your computer and use it in GitHub Desktop.
Save hemantachhami19/7445f187923ef0cc60e7c0de56219fe0 to your computer and use it in GitHub Desktop.
select distinct t1.*
from payments t1
join payments t2
on t2.created_at between (t1.created_at - interval '10 second')
and (t1.created_at + interval '10 second')
and t2.id != t1.id
order by id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment