-
-
Save ldenson11/b7c1a7486e251c664a19b13c52d5728b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- detect fraudulent auths | |
select card as fraudulent_card, | |
count(*) as auth_count, | |
max(amount) as max_amount, | |
tumble_end(eventTimestamp, interval '1' second) as ts_end | |
from paymentauths | |
where amount > 10 | |
group by card, tumble(eventTimestamp, interval '1' second) | |
having count(*) > 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment