SELECT a.*, q.* FROM PostsWithDeleted q INNER JOIN PostsW...

0

Please login or register to vote for this query.

(click on this box to dismiss)

DevOps

Q&A for software engineers working on automated testing, continuous delivery, service integration and monitoring, and building SDLC infrastructure

SELECT a.*, q.*
FROM PostsWithDeleted q INNER JOIN PostsWithDeleted a ON q.Id = a.ParentId
WHERE a.ClosedDate <> q.ClosedDate

/*
SELECT
  'All',
  SUM(CASE PostTypeId WHEN 2 THEN 1 ELSE 0 END) Answers,
  SUM(CASE PostTypeId WHEN 1 THEN 1 ELSE 0 END) Questions
FROM PostsWithDeleted

UNION ALL SELECT
  'Open and not deleted',
  SUM(CASE PostTypeId WHEN 2 THEN 1 ELSE 0 END) Answers,
  SUM(CASE PostTypeId WHEN 1 THEN 1 ELSE 0 END) Questions
FROM PostsWithDeleted WHERE DeletionDate IS NULL AND ClosedDate IS NULL

UNION ALL SELECT
  'Not deleted',
  SUM(CASE PostTypeId WHEN 2 THEN 1 ELSE 0 END) Answers,
  SUM(CASE PostTypeId WHEN 1 THEN 1 ELSE 0 END) Questions
FROM PostsWithDeleted WHERE DeletionDate IS NULL
*/

Enter Parameters

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