Hi I'm trying to use https://data.stackexchange.com/stackoverflow/query/new to get the stack overflow gold medalists from my country. Here is my query,
SELECT TOP 1000
ROW_NUMBER() OVER(ORDER BY Gold badges DESC) AS [#],
UserId AS [User Link],
COUNT(*) AS "Gold badges"
FROM Badges, Users
WHERE Name IN ('Copy Editor', 'Electorate', 'Famous Question', 'Fanatic', 'Great Answer', 'Great Question', 'Legendary', 'Marshal', 'Populist', 'Publicist', 'Reversal', 'Stellar Question', 'Steward', 'Unsung Hero')
AND LOWER(Location) LIKE '%sri lanka%' AND Users.Id = Badges.UserId
GROUP BY UserId
ORDER BY COUNT(*) DESC
What I need to do is to get all my countries gold medalists with gold medal amount name and row number. But I'm getting this error,
Incorrect syntax near the keyword 'DESC'.
it would be great if someone can help.