MATCH_RECOGNIZE - ORA-00933: команда SQL неправильно завершена
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;
при выполнении этого я получаю: ORA-00933: команда SQL не завершена должным образом 00933. 00000 - "команда SQL не завершена должным образом"