Bounty amount with user count before/after 2010-06-18

0

Please login or register to vote for this query.

(click on this box to dismiss)

Code to retrieve the count of bounties and users before and after any user-any bounty change.

Stack Overflow

Q&A for programmers

-- Bounty amount with user count before/after 2010-06-18
-- Code to retrieve the count of bounties and users before
-- and after any user-any bounty change.

SELECT 'Before' 'befaf',
       COUNT(*) bounties,
       (SELECT COUNT(*) FROM Users WHERE CreationDate <= '2010-06-18') 'Users registered'
  FROM Votes
 WHERE CreationDate <= '2010-06-18'
   AND BountyAmount IS NOT NULL
UNION ALL
SELECT 'After',
       COUNT(*),
       (SELECT COUNT(*) FROM Users WHERE CreationDate > '2010-06-18')
  FROM Votes
 WHERE CreationDate > '2010-06-18'
   AND BountyAmount IS NOT NULL
UNION ALL
SELECT 'Total',
       COUNT(*),
       (SELECT COUNT(*) FROM Users)
  FROM Votes
 WHERE BountyAmount IS NOT NULL

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached