'Copy editor' and 'Strunk & White' badges progress (Revamped)

3

Please login or register to vote for this query.

(click on this box to dismiss)

Previous queries haven't taken into consideration all the requirements laid out in http://meta.stackexchange.com/questions/67397/list-of-all-badges-with-full-descriptions#188732.

Internet of Things Meta

Q&A about the site for builders and users of networked sensors and control devices in the contexts of smart homes, industry automation, or environmental sensors

DECLARE @user INT = ##UserId:int##
DECLARE @edits INT

SELECT *
FROM (
  SELECT 
  PH.PostId, P.*
  , ROW_NUMBER() OVER (PARTITION BY PH.PostId ORDER BY PH.CreationDate ASC) [row]
  FROM PostHistory PH
  INNER JOIN Posts as P on PH.PostId=P.Id
  WHERE PH.UserId=@user and P.OwnerUserId <> @user
  AND PH.PostHistoryTypeId in (4, 5)
  AND P.PostTypeId IN (1, 2)
  --AND P.ClosedDate IS NULL
) P
WHERE P.[row] = 1
ORDER BY P.[PostId]

Enter Parameters

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