Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Will the function in the GROUP BY clause be calculated?
Please help me with this statement:
select complex_fun(col_a) from table group by complex_fun(col_a) having count(*)>2
For every row in the table, complex_fun(col_a) will be calculated when oracle scans the table, so will it calculate the function again when oracle encounters the GROUP BY clause? Or it just use the result of calculations in the SELECT clause?
Support there are 1 million rows in the table, and the result set has 0.2 million. So will oracle calculate the function 1 million times or 1+0.2=1.2 million times?
Thanks
Qihua
![]() |
![]() |