Originally posted by slimdave
Grrr.

OK, how about a subquery factoring clause?

Code:
with sfc as
   (
   select
      DoCalculate(
         aLongitude,
         aLATITUDE,
         a.LONGITUDE,
         a.LATITUDE) mileage_calculated
   from
      TABLEx
   )
select
   mileage_calculated
from
   sfc
where
   mileage_calculated is not null;
'Owzat?
Gee! I didn't even know such a beast of a construct exists or is possible in Oracle (I wouldn't be surprised if I saw it in some Celco's article, though)! I see, it's realy time for me to dig into Oracle Manuals and start studying SQL again.

Anyway Slimdave, as much as I hate to dissapoint or irritate you (Grrr?) - it still calls the function twice for any row returned !