Skip to content

Instantly share code, notes, and snippets.

@donovan-duplessis
Created August 29, 2012 07:31
Show Gist options
  • Save donovan-duplessis/3507991 to your computer and use it in GitHub Desktop.
Save donovan-duplessis/3507991 to your computer and use it in GitHub Desktop.
Consultant Reports
SELECT Team.name, User.name, CR.week, CR.id, Team.id, User.id
FROM consultant_reports as CR
JOIN teams AS Team ON (CR.team_id = Team.id)
JOIN admin_users AS User ON (CR.admin_user_id = User.id)
WHERE CR.month = %s
%s
GROUP BY Team.name, User.name, CR.week
ORDER BY Team.name, User.name, CR.week;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment