Skip to content

Instantly share code, notes, and snippets.

@mehdimehdi
Created November 12, 2012 23:55
Show Gist options
  • Save mehdimehdi/4062901 to your computer and use it in GitHub Desktop.
Save mehdimehdi/4062901 to your computer and use it in GitHub Desktop.
Query to get number of points credited per publisher
SELECT sum(points),extract(MONTH from date_created)
FROM activity
WHERE publisher_id='9290' and date_created > '2012-09-01'
GROUP BY extract(MONTH from date_created)
ORDER BY EXTRACT(MONTH from date_created);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment