I have some event stream data, and I’d like to detect whether some events are between other events of known types. I’m familiar with windowing functions but am struggling to find a query here that doesn’t try to nest my window functions. I’m running on Redshift.
As an example with the following data, I’d like to know which events occur after an A or E but before an X or Z.
Transformed, it would look like this:
|Row||Event||Between A/E and X/Z?|