Time between creation and status-review

1

Please login or register to vote for this query.

(click on this box to dismiss)

Bioinformatics

Q&A for researchers, developers, students, teachers, and end users interested in bioinformatics

; with revisions_cte AS (
SELECT
 p.Id AS pid, 
 MIN(ph1.Id) AS phId
FROM PostHistory ph1 INNER JOIN Posts p ON ph1.PostId=p.Id
WHERE ph1.PostHistoryTypeId in (3,6,9)
  and ph1.Text Like '%<##tag1?status-review##>%'  
GROUP BY p.Id  
)

SELECT ph.PostId AS [Post Link],
  url = 'site://posts/' + CAST(ph.PostId AS varchar)+'/revisions',
  p.CreationDate,
  ph.CreationDate, ph.UserId AS [User Link],   
  DATEDIFF(day, p.CreationDate, ph.CreationDate) AS Days,
  DATEDIFF(hour, p.CreationDate, ph.CreationDate) AS Hours,
  DATEDIFF(minute, p.CreationDate, ph.CreationDate) AS Minutes
FROM PostHistory ph INNER JOIN revisions_cte ON ph.Id=phId
  INNER JOIN Posts p ON ph.PostId=p.Id
ORDER BY ph.CreationDate DESC

Enter Parameters

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