user522961 wrote:Adjusting to allow for the error highlighted by specdev, it's not obvious whether or not there should be a difference. We might hope the optimizer would get very clever and realise that both examples were dividing by the same constant. I don't think there's an easy way to be certain - and any difference is probably marginal given the work involved in getting the penultimate intermediate data set.
select FILE_NAME, TABLESPACE_NAME, SUM(BYTES)/1024/1024/1024 from dba_data_files select FILE_NAME, TABLESPACE_NAME, SUM(BYTES)/(1024*1024*1024 ) from dba_data_files
specdev wrote:Slightly more entertaining - under Oracle, addition is not associative, i.e. a + b + c = (a + b) + c, but not a + (b + c)
explain plan for select dummy from dual group by dummy having to_number(dummy)+100/100+100/100 > 0 ; Predicate Information: 1 - filter(TO_NUMBER("DUMMY")+1+1>0)