我在SSRS中执行此oracle时遇到此问题
查询是:
SELECT something
FROM x
WHERE productid <> 'Cash'
AND va.principal IN (WITH t
AS (SELECT ? STR
FROM dual)
SELECT REGEXP_SUBSTR (str, '[^,]+', 1, LEVEL)
SPLIT_VALUES
FROM t
CONNECT BY LEVEL <= (SELECT LENGTH (
Replace (str, ',',
NULL))
FROM t))
ORDER BY cusip,
portfolio
答案 0 :(得分:0)
重写您的查询,看起来像这样。
SELECT something
FROM x va
JOIN (WITH t
AS (SELECT ? STR
FROM dual)
SELECT REGEXP_SUBSTR (str, '[^,]+', 1, LEVEL) split_values
FROM t
CONNECT BY LEVEL <= (SELECT Length (REPLACE (str, ',', NULL))
FROM t)) b
ON va.principal = b.split_values
WHERE productid <> 'Cash'
ORDER BY cusip,
portfolio;