StackOverflowDocumentation
.dbo
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
usp_Q952
Parameters
Name
Type
Mode
@Useless
int
IN
Definition
CREATE PROC [dbo].[usp_Q952] @Useless INT AS BEGIN /* Source: http://data.stackexchange.com/stackoverflow/query/952/top-500-answerers-on-the-site */ SELECT TOP 500 Users.Id as [User Link], Count(Posts.Id) AS Answers, CAST(AVG(CAST(Score AS float)) as numeric(6,2)) AS [Average Answer Score] FROM Posts INNER JOIN Users ON Users.Id = OwnerUserId WHERE PostTypeId = 2 and CommunityOwnedDate is null and ClosedDate is null GROUP BY Users.Id, DisplayName HAVING Count(Posts.Id) > 10 ORDER BY [Average Answer Score] DESC END