My Questions by Views

0

Please login or register to vote for this query.

(click on this box to dismiss)

Operations Research Meta

Q&A about the site for operations research and analytics professionals, educators, and students

DECLARE @UserId int = ##UserId##
CREATE TABLE #MyQuestions (
  Id int,
  Title nvarchar(250),
  ViewCount int,
  ViewCountGroup int,
  CreationDate datetime
)
INSERT INTO #MyQuestions
  SELECT Id, Title, ViewCount,
         FLOOR(EXP(FLOOR(LOG(ViewCount)))) as ViewCountGroup, CreationDate
  FROM Posts p
  WHERE p.PostTypeId = 1
  AND p.OwnerUserId = @UserId

SELECT Title, ViewCount
FROM #MyQuestions
GROUP BY Title, ViewCount
ORDER BY ViewCount DESC

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results