with curse as (select luna,an,valoare from cursl where moneda='eur')
SELECT *
FROM curse MATCH_RECOGNIZE (
ORDER BY an,luna
MEASURES strt.an as start_an, strt.luna as start_luna,
strt.valoare as euro_inc,LAST(scade.valoare) as euro_sf,
count(*) as nr_luni,
strt.valoare-LAST(scade.valoare) as dif
ONE ROW PER MATCH
PATTERN (strt scade{3,})
DEFINE
scade AS scade.valoare < PREV(scade.valoare)
) a
ORDER BY a.start_an,a.start_luna;
when running this I receive : ORA-00933: SQL command not properly ended 00933. 00000 - "SQL command not properly ended"
Aleksej
23.1k6 gold badges39 silver badges41 bronze badges
-
Which Oracle version?Aleksej– Aleksej2017年05月24日 18:14:27 +00:00Commented May 24, 2017 at 18:14
-
Currently I am using Oracle 11g.Anca Ioana– Anca Ioana2017年05月24日 18:17:06 +00:00Commented May 24, 2017 at 18:17
1 Answer 1
According to Oracle-Base:
Oracle 12c has added the MATCH_RECOGNIZE clause
answered May 24, 2017 at 18:18
Aleksej
23.1k6 gold badges39 silver badges41 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
Explore related questions
See similar questions with these tags.
lang-sql