select jc.id as [Comment Link],max(pv.id) as [Post Link],...

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

select jc.id as [Comment Link],max(pv.id) as [Post Link],max(pv.viewcount) as viewcount from
(select p.id,q.viewcount
from
posts q
join posts p
on (q.id = p.parentid or q.id = p.id)) as pv
join
(select id, postid from comments where (text like '%jefromi%' or text like '%Jefromi%')) as jc
on pv.id = jc.postid
group by jc.id
order by viewcount desc

Enter Parameters

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