Information schema for a Table

0

Please login or register to vote for this query.

(click on this box to dismiss)

DON'T EDIT THIS QUERY! YOU HAVE LINKED TO IT FROM HERE: http://meta.stackexchange.com/a/2678/158100 REMEMBER?

Motor Vehicle Maintenance and Repair Meta

Q&A about the site for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles

with acc1 as
(
select count(p.id) coun, DATEPART(m,p.creationdate) m, DATEPART(yyyy,p.creationdate) y,
  pt.tagid tag
  from posts p
  join PostTags pt on p.id=pt.postid 
  where id=pt.postid group by pt.tagid, DATEPART(m,p.creationdate), DATEPART(yyyy,p.creationdate)
),
acc2 as
(
select MAX(a.coun) maxx, a.m months, a.y years, a.tag tags from acc1 a
  group by a.m, a.y, a.tag
)
,
acc3 as
(
select a.months months, a.years years, tg.TagName Tag from acc2 a
  join tags tg on tg.id=a.tags 
)
select * from acc3

Enter Parameters

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