Q&A about the site for followers of the Hindu religion and those interested in learning more about Hinduism
select pid , elapsed_time, accepted, answered from (select p.id as pid, datediff(SECOND, v.creationdate, a.creationdate) as elapsed_time, a.creationdate as answered, v.creationdate as accepted, v.votetypeid as vote_type from posts p, posts a, votes v where a.parentid = p.id and p.acceptedanswerid = v.postid and v.postid = a.id ) s where vote_type = 1 order by elapsed_time desc