Can we export timeline statistics of a post into a csv file?

0

Please login or register to vote for this query.

(click on this box to dismiss)

https://meta.stackoverflow.com/questions/372771/can-we-export-timeline-statistics-of-a-post-into-a-csv-file/372772#372772

Stack Overflow

Q&A for professional and enthusiast programmers

select creationdate
     , [type]
     , [typeid] as [History, vote or post typeid]
     , name
from
(
-- all posthistory events
select creationdate
     , 'hist' [type]
     , posthistorytypeid as typeid
     , name
from posthistory
inner join posthistorytypes pht on pht.id = posthistorytypeid
where postid = ##postid?5963269##
union all
-- all votes
select creationdate
     , 'votes' 
     , votetypeid
     , name
from votes
inner join votetypes vt on vt.id = votetypeid
where postid = ##postid?5963269##
union all
-- all answers (for questions)
select creationdate
     , 'answer'
     , posttypeid
     , 'answer added'
from posts
where parentid = ##postid?5963269##
union all
select creationdate
     , 'review'
     , reviewtasktypeid
     , name
from reviewtasks
inner join reviewtaskstates rts on rts.id = ReviewTaskStateId
where postid = ##postid?5963269##
) data
order by creationdate desc

Enter Parameters

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