with timings as ( select a.owneruserid as [User Link], a....

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

with timings as (
select 
  a.owneruserid as [User Link],
  a.creationdate,
  case 
    when lag(a.creationdate) over (order by a.creationdate) is not null
    then datediff(minute, lag(a.creationdate) over (order by a.creationdate), a.creationdate)
    else null
  end as delta_minutes,
  case
    when lag(a.owneruserid) over (order by a.creationdate) != a.owneruserid
    then 1
    else 0
  end as accountswitch,
  a.id as [Post Link]
from posts a
inner join posts q on a.parentid = q.id and a.posttypeid = 2
inner join posttags pt on q.id = pt.postid
inner join tags t on t.id = pt.tagid
where t.tagname = 'cypress'
and a.owneruserid in (
4716245,
8745435,
9161752,
9622173,
12697177,
14783414,
14903560,
15239601,
15544695,
16003578,
16461847
))
select min(delta_minutes) from timings where accountswitch = 1;

Enter Parameters

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