2021年2月5日星期五

SQL to get 2 adjacent actions from the flag

hope you are doing well!

I have an dummy data as below.

enter image description here

I want to get 2 adjacent actions from the flag by each user.

Here's the chart to describe my thought.

enter image description here

Here's what I want:

enter image description here

How can I implement SQL(I use Google Bigquery)? Hope someone can light me up. Thanks a million!

https://stackoverflow.com/questions/66044663/sql-to-get-2-adjacent-actions-from-the-flag February 04, 2021 at 07:27PM

没有评论:

发表评论