尝试使用以下sql查询创建交互式报告。得到标题中提到的错误。
SELECT
FIRST_NAME||' '||LAST_NAME "USERNAME"
FROM
USERS
WHERE
USERNAME IN (
select
username
from
users
where
username not in (
Select
accessed_by
from
temp_amal
where
access_date >= :P2610_DATE_FROM
and access_date <= :P2610_DATE_TO
and (CASE :P2610_RADIO
when 'F' then col1='F'
end)
)
)
order by 1;
答案 0 :(得分:1)
WHERE
条件的两个操作数不能位于CASE
中。只是其中一个。
SELECT FIRST_NAME||' '||LAST_NAME "USERNAME" FROM USERS WHERE USERNAME
IN
(select username from users
where username not in
(Select accessed_by from temp_amal
where access_date >= :P2610_DATE_FROM
and access_date <= :P2610_DATE_TO
and col1 = (CASE :P2610_RADIO
when 'F' then 'F'
end)
))
order by 1;
所以,如果你想让你的查询更具动态性。您必须生成动态SQL查询。