Search notes:

ORA-62505: expression needs to be aliased

When using match_recognize, the elements in the measures clause need an alias.
create table tq84_tab (
   id     integer         primary key,
   txt    varchar2(10),
   num    number
);
The following (silly) statement throws *ORA-62505: expression needs to be aliased*;
select
   *
from
   tq84_tab match_recognize (
       order by
          id

       measures
          txt,
          num
          
       pattern (a)
          
       define
          a as length(txt) = num

);
This one runs ok:
select
   *
from
   tq84_tab match_recognize (
       order by
          id

       measures
          txt as txt,   -- <== Note the alias
          num as num
          
       pattern (a)
          
       define
          a as length(txt) = num

);

See also

Other Oracle error messages

Index