ViewCount

0

Please login or register to vote for this query.

(click on this box to dismiss)

Skeptics

Q&A for scientific skepticism

DECLARE @UserId int = ##UserId##

SELECT p.Title, p.ViewCount, p.Id, p.Score
FROM Posts p
WHERE p.OwnerUserId = @UserId


UNION

SELECT q.Title, q.ViewCount, q.Id, q.Score
FROM Posts a
JOIN Posts q ON a.ParentId = q.Id
WHERE a.OwnerUserId = @UserId
  AND a.PostTypeId = 2
ORDER BY ViewCount DESC

Enter Parameters

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