I have an example data as below.
+---------+------------+--------+
| user id | sequence | Action |
|---------|------------|--------|
| 12345 | 1 | Run |
| 12345 | 2 | Sit |
| 12345 | 3 | Sit |
| 12345 | 4 | Run |
| 12345 | 5 | Run |
| 12345 | 6 | Sit |
+---------+------------+--------+
Now I'd like the result should be like this:
+---------+---------+
| user id | Action |
|---------|---------|
| 12345 | Run |
| 12345 | Sit |
| 12345 | Run |
| 12345 | Sit |
+---------+---------+
The row with sequence #2 and #3 should be merged, #4 and #5 should be merged. I use 'group by Action' will get answer like the following table, but it isn't what I want:
+---------+---------+
| user id | Action |
|---------|---------|
| 12345 | Run |
| 12345 | Sit |
+---------+---------+
How can I implement SQL(I use Google Bigquery)?
Thanks a million!