Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 949911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:28:44+00:00 2026-05-15T23:28:44+00:00

Inspired by this question on Meta , I wrote two queries on the Stack

  • 0

Inspired by this question on Meta, I wrote two queries on the Stack Exchange Data Explorer, one that counts the total number of Questions Asked by Month on SO and another that counts the Bounties Awarded by Month. How can I combine them so that I have the output in one query? I’d like to see
Year, Month, Questions, Bounties, and Amount in one report.

Questions are recorded in the Posts table where PostTypeId = 1, but bounties are recorded in the Votes table where VoteTypeId = 9.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:28:45+00:00Added an answer on May 15, 2026 at 11:28 pm

    I wrote this in notepad & haven’t worked with data explorer on SO.

    select Isnull(V.Year, P.Year) As Year,
    Isnull(V.Month, P.Month) As Month,
    Isnull(V.Bounties, 0) As Bounties,
    Isnull(V.Amount,0) As Amount ,
    P.Questions
    FROM
    (
    select
    datepart(year, Posts.CreationDate) Year,
    datepart(month, Posts.CreationDate) Month,
    count(Posts.Id) Questions
    from Posts
    where PostTypeid = 1 -- 1 = Question
    group by datepart(year, Posts.CreationDate), datepart(month, Posts.CreationDate)
    ) AS P
    left JOIN
    (
    select
    datepart(year, Votes.CreationDate) Year,
    datepart(month, Votes.CreationDate) Month,
    count(Votes.Id) Bounties,
    sum(Votes.BountyAmount) Amount
    from Votes
    where VoteTypeId = 9 -- 9 = BountyAwarded
    group by datepart(year, Votes.CreationDate), datepart(month, Votes.CreationDate)
    ) AS V
    ON P.Year = V.Year AND P.Month = V.Month
    order by P.Year, P.Month
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question was inspired by one I asked almost a year ago - any-orms-that-work-with-ms-access-for-prototyping
Inspired by the discussion in this question . We have all been taught that
Is 'eval' supposed to be nasty? inspired this one: Mostly everybody agrees that eval
This is directly inspired by this question . There are numerous references/statements that bitwise
This question was inspired by this answer to another question, indicating that you can
Inspired by this question , the asker assumes that the users of a system
This is inspired by this question and the comments on one particular answer in
Somewhat inspired by this question about a graphical programming environment. I don't think that
Inspired by this question , I'd like to know whether there is any trick
This question is inspired by this question . I'd like to get a dictionary

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.