select ABS (SUM) question

i have a survey that dumps the results to a mysql database....fome time to time we will have anywhere from 12 responses to over 700+. the survey choices range from 1-6 with six being highest (1-6 = very dissatisifed - very satisfied)

one of the survey metrics is "give me % for all those answers 3 (satisfied) or higher" which in mysql translates to:

SELECT ABS( SUM( Q1 >3  )  /21  )...etc.

as i have the query right now it works great...the problem lies in the fact, as stated earlier...the number of responses varies each time and the "/21" of the query SELECT ABS( SUM( Q1 >3  )  /21  ) will change often....without having to go and rewrite the query each time...is there a way to use the COUNT feature in mysql to populate the "/XXX" part of the query?

thanks


full query
------------------------
SELECT ABS( SUM( Q1 >3  )  /21  ) , ABS( SUM( Q2 >3  )  /21  ) , ABS( SUM( Q4 >3  )  /21  ) ,ABS( SUM( Q5 >3  )  /21  ),ABS( SUM( Q6 >3  )  /21  ),ABS( SUM( Q6 >3  )  /21  )  
FROM metrics
nriddockAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hernst42Commented:
Does
SELECT ABS( SUM( Q1 >3  )  / COUNT(Q1)  ) , ABS( SUM( Q2 >3  )  /COUNT(Q1)  ) , ABS( SUM( Q4 >3  )  /COUNT(Q1)  ) ,ABS( SUM( Q5 >3  )  /COUNT(Q1)  ),ABS( SUM( Q6 >3  )  /COUNT(Q1)  ),ABS( SUM( Q6 >3  )  /COUNT(Q1)  )  FROM metrics

not work ??
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nriddockAuthor Commented:
perfect...thanks for the quick response
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.