select top 100 p.id as [Post Link], p.Score as 'vot', max...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Woodworking Meta

Q&A about the site for professional and amateur woodworkers

select top 100 p.id as [Post Link],
  p.Score as 'vot',
  max(a.Score) as 'max',
  p.AnswerCount as 'qty',
  datediff(day, p.CreationDate, CURRENT_TIMESTAMP) / 30 as mos,
  round(30.4375 * p.ViewCount / datediff(day, p.CreationDate, CURRENT_TIMESTAMP), 2) as 'freq',
  p.ViewCount as 'views'
from Posts as p
  left join Posts as a
  on a.ParentId = p.Id
where p.PostTypeId = 1
  and (p.ClosedDate IS NOT NULL
  or p.DeletionDate IS NOT NULL)
  and p.Body like '%solar%'
group by p.id, p.score, p.viewcount, p.answercount, p.creationdate
order by p.ViewCount / datediff(day, p.CreationDate, CURRENT_TIMESTAMP) desc

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results