AAD Graph Weighted

1

Please login or register to vote for this query.

(click on this box to dismiss)

The Workplace Meta

Q&A about the site for members of the workforce navigating the professional setting

DECLARE @Keywords nvarchar(100) = '%##Keywords##%'

CREATE TABLE #unanswered (Id int primary key, UnansweredSkew int)
INSERT #unanswered
SELECT q.Id as Id, 
CASE WHEN q.AcceptedAnswerId is null THEN -10 
     WHEN q.AcceptedAnswerId is not null THEN 0 END AS [Total]
FROM Posts q
WHERE q.Tags LIKE '%azure-active-directory%' AND q.Body LIKE @Keywords

SELECT TOP 100 p.Id AS [Post Link], 
p.ViewCount, 
p.AnswerCount, 
CASE WHEN p.AcceptedAnswerId is null THEN 'false' ELSE 'true' END AS Answered,
((p.ViewCount * 0.01) + p.AnswerCount + u.UnansweredSkew) AS Weight,
CAST (p.CreationDate as date) as Created,
CAST((GETDATE() - p.CreationDate) AS INT) as Age

FROM Posts p
JOIN #unanswered u ON u.Id = p.Id
ORDER BY Answered ASC, Weight DESC

Enter Parameters

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