Lee Kyoung Rok wrote :
>
> Change
> (HEADWATER - TAILWATER) / 100
> to
> (HEADWATER - DECODE(TAILWATER,HEADWATER,NULL,TAILWATER,TAILWATER))/100
Some remarks :
- That's OK, but, if it happens, the sum will be NULL ! I think 0 (zero) is
a better solution.
In that case, replace :
( (WATER_SURFACE - TAILWATER) / ((HEADWATER - TAILWATER) / 100) )
by
DECODE(HEADWATER,
TAILWATER, 0,
(WATER_SURFACE - TAILWATER) / ((HEADWATER -
TAILWATER) / 100) )
- On every line, you used decode(instrument_name, '01-1',...), but,
according to the selection
clause, this will be always true (fortunately, because if it isn't, the
decode and the sum will be NULL).
So it seems that it's unusefull.
- The sixth line seems to be a percentage, are you sure you want to add them
? An average can't be
more significative (for the other lines too)? In that case, you just
have to divide each sum by a
count(*) ou use the avg() instead of sum().
Regards
Pierre
Received on Wed Dec 08 1999 - 07:05:49 CST