connect by clause in regex_substr

后端 未结 3 699
星月不相逢
星月不相逢 2020-12-08 05:37

I cant get the understanding of this statement - not eveN after googling around

 
pv_no_list :=\'23,34,45,56\';
SELECT   DISTINCT REGEXP_SUBSTR (pv_no_li         


        
3条回答
  •  春和景丽
    2020-12-08 05:49

    connect by has nothing to do with regex_substr:

    • The first is to perform a hierarchical query, see http://docs.oracle.com/cd/B19306_01/server.102/b14200/queries003.htm

    • The second is to get a substring using regular expressions.

    This query "abuses" the connect by functionality to generate rows in a query on dual. As long as the expression passed to connect by is true, it will generate a new row and increase the value of the pseudo column LEVEL.

    Then LEVEL is passed to regex_substr to get the nth value when applying the regular expression.

提交回复
热议问题