The answer for you can be using HAVING
instead of WHERE
:
WITH f AS (SELECT 12 AS column1 FROM dual),
s AS (SELECT 33 AS column2 FROM dual)
SELECT f.column1, 0.9*SUM(s.column2) FROM f,s
HAVING f.column1 = f.column1*0.9*SUM(s.column2);
But what is the idea of statement WHERE f.colum1 = f.column1*0.9*sum(s.colum2)
?
It compares the values in the row in the first colunm and compare them with the same value multiplied by 0.9*SUM(s.colum2)
. The query will therefore return nothing if 0.9*SUM(s.colum2) != 1
and all rows if 0.9*SUM(s.colum2) == 1
.