esperti di SQL aiuto !!!

Collapse
X
 
  • Filter
  • Ora
  • Show
Clear All
new posts
  • Albe
    Mental Case
    • Dec 2000
    • 18165
    • 466
    • 178
    • nella mia mente
    • Send PM

    esperti di SQL aiuto !!!

    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
    Powerlifting instructor level III FIPL/AIF
    Certified Personal Trainer by International Sports Sciences Association
    Master Slim coach by 4move

    CONTATTI: tecalbe@hotmail.it / Facebook
    / Blog personale
Working...
X