tigidig

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow en español

Preguntas y respuestas para programadores y profesionales de la informática

;WITH recordsList
AS
(
	SELECT 	'http://stackoverflow.com/users/' + CAST(p.OwnerUserId AS VARCHAR(10)) AS OwnerLink,
			'http://stackoverflow.com/questions/' + CAST(p.ID AS VARCHAR(10)) AS QuestionLink,
			p.Score,
			p.ViewCount,
			p.FavoriteCount,
			p.Title,
			LEN(p.Title) AS TitleLength,
			LEN(p.Body) AS BodyLength,
			p.Tags,
			p.CreationDate,
			u.Reputation,
			ROW_NUMBER() OVER 
			(PARTITION BY p.OwnerUserId 
			ORDER BY p.Score DESC) UserAnswerSequence,
			CASE WHEN CHARINDEX('<code>', p.Body) > 0 THEN 'True' ELSE 'False' END ContainsCodeBlock
	FROM 	Posts AS p
			INNER JOIN Users As u
				ON	p.OwnerUserId = u.Id
			INNER JOIN PostTags AS pt
				ON 	pt.PostId = p.Id
	WHERE 	p.PostTypeId = 1 								-- <<== Questions
			AND p.CommunityOwnedDate IS NULL  				-- <<== not WIKI
			AND pt.TagId = 3143								-- <<== SCALA
)
SELECT	TOP 5000
		OwnerLink,
		QuestionLink,
		Score,
		ViewCount,
		FavoriteCount,
		Title,
		TitleLength,
		BodyLength,
		Tags,
		CreationDate,
		ContainsCodeBlock
FROM	recordsList
WHERE	UserAnswerSequence <= 50
ORDER 	BY Reputation DESC, Score DESC

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results