I have a SQL table called KbRank with the following columns:
KBID RANKINGSCORE
1 100
2 50
1 100
1 75
3 0
5 25
2 100
3 100
1 0
I am attempting to write a SQL query that will find the top 3 KBID's with the highest cummulative ranking score. So I would want to add all of the RANKINGSCORE's for KBID1 up, all of the RANKINGSCORE's for KBID2 up etc, and then sort the results and grab the top 3.
I'm not much of a SQL guru but I think I would need to use a select statement with SUM to accomplish this. Can anyone point me in the right direction or offer any pointers?
Thanks
Brad
KBID RANKINGSCORE
1 100
2 50
1 100
1 75
3 0
5 25
2 100
3 100
1 0
I am attempting to write a SQL query that will find the top 3 KBID's with the highest cummulative ranking score. So I would want to add all of the RANKINGSCORE's for KBID1 up, all of the RANKINGSCORE's for KBID2 up etc, and then sort the results and grab the top 3.
I'm not much of a SQL guru but I think I would need to use a select statement with SUM to accomplish this. Can anyone point me in the right direction or offer any pointers?
Thanks
Brad
Comment