What you did

1

Please login or register to vote for this query.

(click on this box to dismiss)

Physics

Q&A for active researchers, academics and students of physics

DECLARE @AccountId INT;
SELECT @AccountId = Id
FROM Users
WHERE AccountId = ##SEAccountId:int?1988549##;

SELECT
  COALESCE(Posts.ParentId, Posts.Id) AS [Where],
  'created' AS Verb,
  PostTypes.Name AS Object,
  Posts.CreationDate AS [When]
FROM Posts, PostTypes
WHERE
  Posts.OwnerUserId = @AccountId
  AND
  Posts.PostTypeId = PostTypes.Id

UNION

SELECT
  COALESCE(Posts.ParentId, Posts.Id) AS [Where],
  'commented' AS Verb,
  PostTypes.Name AS Object,
  Comments.CreationDate AS [When]
FROM Comments, Posts, PostTypes
WHERE
  Comments.UserId = @AccountId
  AND
  Comments.PostId = Posts.Id
  AND
  Posts.PostTypeId = PostTypes.Id

ORDER BY [When];

Enter Parameters

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