whyt

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
  A.ID as [Post Link],
  *
from
  (
  select
    sum(case when C.Text like '%tried%' then 1 else 0 end) as TriedComments,
    P.ID
  from
    Posts as P
    left join Comments as C on C.PostID = P.ID 
  where    
    P.creationdate > '2013-01-01'
    and P.posttypeid = 1
  group by
    P.ID
    ) as A
where
  A.TriedComments > 1
order by
  A.TriedComments desc

Enter Parameters

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