Skip to content

Instantly share code, notes, and snippets.

@eezhal92
Created February 13, 2016 02:58
Show Gist options
  • Save eezhal92/2d8c6b334e403089e756 to your computer and use it in GitHub Desktop.
Save eezhal92/2d8c6b334e403089e756 to your computer and use it in GitHub Desktop.
sql sleekr
select c.name, count(u.name) as co from company c
join users u on c.id = u.company
where datediff(now(), u.join_date) >= 365
and u.gender = 'male' group by c.name;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment