I have a complicated query that has to use a number called SubUnitRate. This variable comes from another table with special condition. in short we have:
DECLARE
SUBUNITRATE NUMBER;
BEGIN
SELECT NVL (NULLIF (CU.SUBUNITRATE, 0), 1)
INTO SUBUNITRATE
FROM CURRENCYS CU
JOIN ACCOUNTS ACC ON CU.ID = ACC.CURRENCY
WHERE ACC.ID = :ACCOUNTID;
END;
SELECT SUBUNITRATE * 100 FROM DUAL;
My goal is to acquire the result of(in simple case):
SELECT SUBUNITRATE * 100 FROM DUAL;
But how is that possible?