Skip to content

Instantly share code, notes, and snippets.

@thomsbg
Created October 15, 2013 14:56
Show Gist options
  • Save thomsbg/6992891 to your computer and use it in GitHub Desktop.
Save thomsbg/6992891 to your computer and use it in GitHub Desktop.
select billings.cost, employees.name
from (
select cost, employee_id from past_billings
union
select (hours * rate) as cost from future_billings
) billings
join employees on employees.id = billings.employee_id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment