Skip to content

Instantly share code, notes, and snippets.

@ihoka
Created November 4, 2009 09:26
Show Gist options
  • Save ihoka/225909 to your computer and use it in GitHub Desktop.
Save ihoka/225909 to your computer and use it in GitHub Desktop.
select * from objectives where company_id = 2
union
select * from objectives
where (concat(coalesce(area_group, '-'), '|', key_result) not in
(select concat(coalesce(area_group, '-'), '|', key_result) from objectives where company_id = 2))
and (company_id is null)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment