Skip to content

Instantly share code, notes, and snippets.

@RelativeTech
Created March 25, 2021 20:40
Show Gist options
  • Save RelativeTech/eb722c70fff76ea0a71fce56ac3bc491 to your computer and use it in GitHub Desktop.
Save RelativeTech/eb722c70fff76ea0a71fce56ac3bc491 to your computer and use it in GitHub Desktop.
select p.project_name, sum(w.compensation) as TotalComp
from project p, worker w, project_worker_map m
where m.project_id = p.id
and m.worker_id = w.id
and m.worker_id in (
select id from worker where worker_code in('CODE-1', 'CODE-2')
)
group by p.project_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment