tabella oracle :
campi--- x--- y--- z
valori--- 23-- 34---56
----------0----0---89
----------78---11--100
----------56---0---0
come ***** faccio a calcolare la media aritmetica non considerando gli 0 ???
io ho pensato a questa ma mi da errore:missing expression
select (sum(x)+sum(y)+sum(z))as tot,((sum(x)+sum(y)+sum(z))/(distinct(select count(*) from table where x>0) + distinct(select count(*) from table where y>0) + distinct(select count(*) from table where z>0))) as media from table
campi--- x--- y--- z
valori--- 23-- 34---56
----------0----0---89
----------78---11--100
----------56---0---0
come ***** faccio a calcolare la media aritmetica non considerando gli 0 ???
io ho pensato a questa ma mi da errore:missing expression
select (sum(x)+sum(y)+sum(z))as tot,((sum(x)+sum(y)+sum(z))/(distinct(select count(*) from table where x>0) + distinct(select count(*) from table where y>0) + distinct(select count(*) from table where z>0))) as media from table