Hi,
I have the following table:
anomaly:
that looks like this:
exec_id account_id is_alerted
100 123 0
.
.
95 123 0
94 123 0
93 123 0
92 123 0
91 123 1
100 234 0
.
.
95 234 0
94 234 0
93 234 0
92 234 0
91 234 0
I need a query that returns the accounts that meet the following condition:
for each account - the gap between is_alerted = 0 and is alerted = 1 is exactly 12 exec_ids