sql19(Leetcode1211查询结果的质量和占比)

代码:

# Write your MySQL query statement below

select query_name,round(avg(rating/position),2) as quality,round(sum(if(rating<3,1,0))/count(rating)*100,2) as poor_query_percentage
from Queries
group by query_name

你可能感兴趣的:(leetcode)