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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SELECT AVG clause

Status
Not open for further replies.

fenneraj

Programmer
Jul 29, 2003
21
SE
I need to select a group of fields with numerical values from a table in my database. E.g. I have a table called answers, this contains qu1Radio (which contains a numeric value) then qu1Comment (which contains text). These go all the way upto qu6Radio. I want to take an average of all the qu*Radios for each record and display these using a cold fusion graph.

If anyone knows how to do this (The SQL part) then i would be very grateful.

Andrew Fenner
 
Code:
select (qu1Radio + qu2Radio + qu3Radio + qu4Radio +
qu5Radio + qu6Radio) / 6 from answers
 
select record,
(qu1Radio + qu2Radio + qu3Radio + qu4Radio +
qu5Radio + qu6Radio) / 6
from answers

group by record
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top