Skip to content

Instantly share code, notes, and snippets.

@bakura10
Created July 11, 2012 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bakura10/3089590 to your computer and use it in GitHub Desktop.
Save bakura10/3089590 to your computer and use it in GitHub Desktop.
SELECT
COUNT(a0_.id) AS sentApplications,
SUM(IF(a0_.status = 16, 1, 0)) AS acceptedApplications,
SUM(IF(a0_.status = 32 AND m1.`status` = 1, 1, 0)) as finished
FROM Applications a0_
JOIN Missions m1 ON a0_.mission_id = m1.id
WHERE a0_.student_id = 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment