SELECT year(question.creationdate) Years, count(*) Counts...


Please login or register to vote for this query.

(click on this box to dismiss)

Android Enthusiasts

Q&A for enthusiasts and power users of the Android operating system

SELECT year(question.creationdate) Years, count(*) CountsWithoutAcceptedAns FROM 
  Posts AS Question 
  Question.Tags LIKE '%java%' AND 
  Question.Body LIKE '%<code>%' and 
  posttypeid = 1 
  --and datepart(year,creationdate) = 2008
  --and question.creationdate BETWEEN @STARTDATE AND @ENDDATE
  and AcceptedAnswerId  is not null and Score > 0
  and id not in (
  FROM Posts d  -- d=duplicate
    LEFT JOIN PostHistory ph ON ph.PostId = d.Id
    LEFT JOIN PostLinks pl ON pl.PostId = d.Id
    LEFT JOIN Posts o ON o.Id = pl.RelatedPostId  -- o=original
    d.PostTypeId = 1  -- 1=Question
    AND pl.LinkTypeId = 3  -- 3=duplicate
    AND ph.PostHistoryTypeId = 10  -- 10=Post Closed
    --and datepart(year,d.creationdate) BETWEEN @STARTDATE AND @ENDDATE
  group by year(question.creationdate)

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results