I have a query which shows ‘High Scores’ in the last week. What I need next is to modify this to give the top 3 high scores but including ties such as:
{2FC28DA7-6CD3-4DC0-8465-98534B8F75AD} Bob 250
{2CF80760-B372-4C3D-8BFD-DBAEF4397442} Bill 123
{77F0C9D1-414B-4ABB-8FC0-D1E88969EA6A} Ben 123
{35F0C921-4443-4A30-8AC1-E3288969E4B3} Baz 101
Here’s what I have so far, I really don’t know where to start being a beginner with SQL:
SELECT TOP (3) tblAccounts.accountID, tblAccounts.contactName, SUM(MONMWins.Points) As ttlPoints
FROM MONMWins
INNER JOIN tblAccounts
ON MONMWins.accountID = tblAccounts.accountID
WHERE MONMWins.dateAdded > DATEADD(wk, DATEDIFF(wk, 6, GETDATE()), 6)
GROUP BY tblAccounts.accountID, tblAccounts.contactName
ORDER BY ttlPoints DESC, tblAccounts.contactName
5