Home > database >  ORACLE how to filter out there N consecutive data
ORACLE how to filter out there N consecutive data

Time:01-27

Data table is as follows (the id column can be any form, can be a GUID, not necessarily have to 1, 2, 3... )

Id val
1 a
2 a
3 a
4 b
5 b
6 c
7 a
8 a
9 d
10 d
11 d
12 d

How to use SQL statements to filter out the val column continuous repeated 3 times and above data, the results back
Id val
1 a
2 a
3 a
9 d
10 d
11 d
12 d

Pray god give directions
  • Related