Home » RDBMS Server » Server Administration » Re: Please Help : How to Average
Re: Please Help : How to Average [message #373187] Tue, 03 April 2001 02:20
eshwar_it@hotmail.com
Messages: 1
Registered: April 2001
Junior Member
Hi,

Query to find the avg for repeated student-id's:

select (sum(nvl(maths,0))+sum(nvl(english,0))+
sum(nvl(physics,0))+sum(nvl(chemistry,0)))
/(sum(decode(maths,null,0,1))+sum(decode(english,null,0,1))+
sum(decode(physics,null,0,1))+sum(decode(chemistry,null,0,1))) avg
from students group by stud_id

Hope this would help.

Eshwar.
Previous Topic: Oracle Applications
Next Topic: Re: Please Help : How to Average
Goto Forum:
  


Current Time: Mon Dec 23 05:34:41 CST 2024