Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with t as
- (select 1 id11, 10 id12, 1 id21, 10 id22 from dual union all
- select 2, null, 2, null from dual union all
- select 3, null, 15, null from dual union all
- select 4, null, 9, null from dual)
- select
- id11
- from t
- match_recognize
- (
- order by id11, id21
- measures classifier() as cls
- all rows per match
- pattern (a b+)
- define
- a as id12 is not null and id22 is not null,
- b as id11 <= prev(id12) and id11 >= prev(id11) and id21 <= prev(id22) and id21 >= prev(id21)
- )
- where cls = 'B'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement