Most Popular Questions that are [CLOSED]!

1

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

-- Closed questions within Top 100% highest Score, Favorites, or Views (Shouldn't they be auto re-assessed?)
-- [I haven't figured out how to add "Close Reason" yet!...]

select 
  id AS [Post Link],
  score as Score, 
  favoritecount as Favs, 
  viewcount as Views, 
  answercount as Answers, 
  
  --creationdate,
  case when datediff(d,creationdate,getdate())<365 
     then cast(datediff(d,creationdate,getdate()) as varchar(3)) + ' days ago'
     else cast(datediff(yy,creationdate,getdate()) as varchar(3)) + ' yr ago'
  end as Created,
  
  --closeddate,
  case when datediff(d,closeddate,getdate())<365 
     then cast(datediff(d,closeddate,getdate()) as varchar(3)) + ' days ago'
     else cast(datediff(yy,closeddate,getdate()) as varchar(3)) + ' yr ago'
  end as Closed,

  --lastactivitydate, 
  case when datediff(d,lastactivitydate,getdate())<365 
     then cast(datediff(d,lastactivitydate,getdate()) as varchar(3)) + ' days ago'
     else cast(datediff(yy,lastactivitydate,getdate()) as varchar(3)) + ' yr ago'
  end as LastActive,
  
  tags as [Tags]

from
  posts
  
where
  posttypeid=1
  and closedDate is not null 
  and deletiondate is null
  and 
     ( score >=610
     or favoritecount >= 888
     or viewcount >= 1470813 )

order by
   cast(score as float) * cast(favoritecount as float) * cast(viewcount as float) desc

Enter Parameters

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