troubleshooting Question

Return % of returns with value

Avatar of SheppardDigital
SheppardDigital asked on
MySQL Server
6 Comments1 Solution162 ViewsLast Modified:
Hi,

I have a table with the following fields;

id
player_id = int
fixture_id = int
up_vote = bool

I'm trying to come up with a query where I can return the % of results where the up_vote is equal to 1

so if there are 100 rows for fixture_id 78, and the value of up_vote in 75 of those rows in 1, then the result would be 75%.

I don't really know where to start with this one without performing multiple queries which I'm trying to avoid if I can.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros