There is a common function:
CREATE OR REPLACE FUNCTION ISFUNC(ID IN NUMBER) RETURN VARCHAR2 IS BEGIN IF (ID = 2 OR ID = 5) THEN RETURN('TRUE'); ELSE RETURN('FALSE'); END IF; END ISFUNC; / Its essence seems to be clear. How can I insert a SELECT into it? Those. That in IF there were not specific numbers, and result? Suppose, for example, there is such a SELECT:
SELECT id FROM Table The result of this select is two lines: 2 and 5.
How to insert this SELECT correctly into a function? I tried in the IF myself, but I realized that it was not correct.