SELECT /*main.Question,*/ MIN(main.QuestionDate) as period,

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
    /*main.Question,*/
    MIN(main.QuestionDate) as period,
    /*main.ViewCount,
    main.AnswerDate,
    main.AnswerId,
    main.AnswerScore,*/
    AVG(CASE
        WHEN main.GooglerAnswer = 'True' THEN 100.0
        ELSE 0.0
      END) as PercentageGooglerAnswered,
    AVG(CASE
        WHEN main.AnswerId IS NULL THEN 0.0
        ELSE 100.0
      END) as PercentageAnswered
FROM (

  SELECT
        Questions.Id as 'Question',
        Questions.CreationDate as 'QuestionDate',
        Questions.ViewCount as 'ViewCount',
        Answers.CreationDate as 'AnswerDate',
        Answers.Id as 'AnswerId',
        Answers.Score as 'AnswerScore',
        Answers.OwnerUserId as Answerer,
        ROW_NUMBER() OVER (PARTITION BY Questions.Id ORDER BY Answers.Score DESC) as 'AnswerNum',
        CONCAT('https://stackoverflow.com/questions/', Questions.Id) as 'Link',
        Questions.Tags as 'Tags',
        (CASE
          WHEN Answers.OwnerUserId IN (1255356, 4696015, 4848113, 949327, 
          582333, 11337033, 3175889, 3705363) THEN 'True'
          ELSE 'False'
          END) as GooglerAnswer
      FROM
        Posts as Questions
        LEFT OUTER JOIN Posts as Answers ON (Answers.ParentId = Questions.Id)
      WHERE Questions.Tags LIKE '%google-cloud-dataflow%'
  ) AS main
GROUP BY DATEPART(month, main.QuestionDate), DATEPART(year, main.QuestionDate)
    ORDER BY period

Enter Parameters

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