如何使用 cte 进行模式匹配?
我尝试过以下操作:
with cte1 as (
select '''' || '{' || accountids || '}' || '''' as accountids
from table_a
where email = '[email protected]'
)
select id
from table_a
where accountids ^@ ANY (select accountids from cte1);
我希望结果集返回 a12 和 c45。这可能吗?