Skip to content

Instantly share code, notes, and snippets.

@slacken
Created September 13, 2012 10:24
Show Gist options
  • Select an option

  • Save slacken/3713423 to your computer and use it in GitHub Desktop.

Select an option

Save slacken/3713423 to your computer and use it in GitHub Desktop.
update school set male = (
SELECT count( id )
FROM student
WHERE gender =1 and student.school = school.id
GROUP BY school
),female = (
SELECT count( id )
FROM student
WHERE gender =0 and student.school = school.id
GROUP BY school
)
@slacken
Copy link
Author

slacken commented Sep 13, 2012

update school set index = (female/pow(male/female,1.5))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment