You'll need to use the SUM function and group by to calculate the total for each kbid, and use order by to list the kbid's in descending order. Finally, you'll leverage the subqueryconstru ct to find the top 3 kbid's.
The SQL to use (this works in MySQL) is:
select kbid from
(select kbid, sum(rankingscor e)
from kbrank
group by kbid
order by sum(rankingscor e) desc) li1
limit 3;
User Profile
Collapse
Leave a comment: