ORACLE SQL get difference of two values retrieved from 2 select statements
Untested but should work:
SELECT
(SELECT value from table where date between DATE1 and DATE2) -
(SELECT value from table where date between DATE3 and DATE4)
FROM dual;
Assuming that your SELECT value
is guaranteed to return a single value
SELECT value FROM TBL WHERE date BETWEEN DATE1 and DATE2
AND value NOT IN (SELECT value FROM TBL WHERE date BETWEEN DATE3 AND DATE4)
If you think your inner queries can give multiple values, use below
SELECT
(SELECT sum(value) from table where date between DATE1 and DATE2) -
(SELECT sum(value) from table where date between DATE3 and DATE4) as answer
FROM dual;