Query consecutive records and apply some logic on it

I have a data as -

time data
t0 10
t1 2
t3 -1
t4 -1
t5 -1
t6 -1
t7 4

How to query to find if there are 3 consecutive -1 in the data?

I do not have an answer to your question, but I would just like to observe
that I think this is one of the most challenging database questions I’ve ever
come across.

A simple enough question for humans, but I shall be fascinated if anyone can
come up with a database query which can do this :slight_smile:


1 Like