-
-
Save ujnak/907f71153920f144f71a70fd9c6cd874 to your computer and use it in GitHub Desktop.
MATCH_RECOGNIZE句を含んだSQLのサンプル
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select mr_rt.* | |
from mrec_request_transitions_v | |
match_recognize( | |
partition by request_id | |
order by transition_date | |
measures | |
count(*) as cnt, | |
classifier() as cls, | |
match_number() as mno | |
all rows per match | |
after match skip to last p | |
pattern ( (r s){2,} a p ) | |
define | |
r as r.status = 'REJECTED' | |
,s as (s.status = 'SUBMITTED' and amount > prev(amount)) | |
,a as a.status = 'APPROVED' | |
,p as p.status = 'PAID' | |
) mr_rt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment