SELECT HighestViewCount = MAX(p.ViewCount) INTO #vc FROM ...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Literature Meta

Q&A about the site for scholars and enthusiasts of literature

SELECT
HighestViewCount = MAX(p.ViewCount)
INTO #vc
FROM posts p 
WHERE 1=1
  AND p.CreationDate BETWEEN '2020-10-01' AND '2020-12-31 23:59:59:997'


SELECT
 * 
FROM #vc vc
JOIN Posts p on p.ViewCount = vc.HighestViewCount
JOIN Users u on u.id = p.OwnerUserid
WHERE 1=1
  AND p.CreationDate BETWEEN '2020-10-01' AND '2020-12-31 23:59:59:997'

Enter Parameters

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