[英]Dynamic pattern quantifier usage in match_recognize clause
示例查詢:
select * from table
match_recognize (
order by column1
pattern (anything {**3**,})
define
anything as column1 = 'col'
);
考慮到我有一個表,我想找到遵循定義模式的連續行。 但是對於上面的示例,我正在尋找一種動態傳遞數字而不是傳遞 static 值 3 的方法。
我曾嘗試使用綁定變量、子查詢,但似乎沒有任何效果。 有沒有什么方法可以將相同的匹配識別查詢與動態量詞一起使用?
If any non-numeric literal is entered it is throwing this error.
SQL Error: ORA-62501: invalid value specified for bounded quantifier in MATCH_RECOGNIZE clause
62501. 00000 - "invalid value specified for bounded quantifier in MATCH_RECOGNIZE clause"
Oracle 版本:19c
如果有人遇到過這種情況,請您幫助我。 提前致謝。
MATCH_RECOGNIZE
不允許您在模式匹配子句中使用動態值; 相反,您可以將查詢編寫為:
SELECT *
FROM (
SELECT t.*,
COUNT(*) OVER () AS num_rows
FROM table_name
WHERE column1 = 'col'
)
WHERE num_rows >= :required_rows
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.