All the distinct days on which I created posts

0

Please login or register to vote for this query.

(click on this box to dismiss)

elementary OS Meta

Q&A about the site for developers and users of elementary OS and applications

select 
  CreationDate,
  sum(lag_days) over (order by CreationDate) as chain
  
from 
(select top 20
CreationDate,
(
  CASE WHEN datediff(day,lag(CreationDate) 
  OVER 
    (PARTITION by OwnerUserId order by CreationDate),CreationDate)>0 
    then 1 else 0 
  end
) as lag_days,
  row_number() over (order by CreationDate) as rn
  from Posts 
  where OwnerUserId=1144035) t

Enter Parameters

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