Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql query for mean,mode,median

Status
Not open for further replies.

latha9

Programmer
Dec 20, 2005
12
US
Hi,

I need to find the score reported and no score reported for that I have written the following query and I got the result.

select count(case when va.ANSWER <= to_char(sysdate) then 1 end ) "Reported a Score",
count(case when (va.ANSWER is null or va.ANSWER > to_char(sysdate ,'mm/dd/yyyy')) then 1 end ) "No Score Reported"
from instrument i,dept_assessment da,v_assessment_answer va
where da.INS_ID=i.INS_ID
and va.INS_ID= i.INS_ID
and va.ASSMT_ID=da.ASSMT_ID
and va.INS_QUES_TXT='Date of LOCUS (mm/dd/yyyy)'


now I have to find out the the average,mode,median,high and low range for reported a score column.actually this is a date datatype and I am finding the count.i don’t understand how to find these.Can anyone suggest how to write a query for mode,mean,average,median,max and min.
when I use the following query I would get the records for “reported a score” column

select va.ANSWER
from v_assessment_answer va
where va.INS_QUES_TXT='Date of LOCUS (mm/dd/yyyy)'
and va.ANSWER <= to_char(sysdate)


Thanks,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top