select p.id as [Post Link], (case when p.title is not nul...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Mi Yodeya

Q&A for those who base their lives on Jewish law and tradition and anyone interested in learning more

select
  p.id as [Post Link],
  (case when p.title is not null then p.title else pq.title end) as title, 
  p.creationdate,
  p.lastactivitydate,
  p.score,
  (case when p.viewcount is not null then p.viewcount else pq.viewcount end) as viewcount
from posts p
left outer join posts pq on pq.id = p.parentid
where p.body like '%chabadlibrary.org%search=%'
order by viewcount desc

Enter Parameters

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