你可以把它们都放进
NOT EXISTS
检查
DECLARE
l_flag INTEGER;
BEGIN
SELECT
CASE
WHEN NOT EXISTS (
SELECT 1
FROM schema.member
WHERE condition1 = 'somecondition'
) AND NOT EXISTS (
SELECT 1
FROM schema.ta a
JOIN schema.b ON a.id = b.id --use proper join syntax
WHERE a.id != 'input_id' AND a.id IN ('M','N')
AND a.id IS NOT NULL -- no nulls as you said.
) AND NOT EXISTS (
SELECT 1
FROM schema.tc
JOIN schema.tb ON condition3 = '<somecondition>'
WHERE member IS NOT NULL -- no nulls as you said.
) THEN 1
ELSE 0
END
INTO l_flag
FROM dual;
IF
l_flag = 1
THEN
do_something;
END IF;
END;
/