Skip to content

Instantly share code, notes, and snippets.

@ollyjackson
Created March 2, 2010 10:28
Show Gist options
  • Save ollyjackson/319416 to your computer and use it in GitHub Desktop.
Save ollyjackson/319416 to your computer and use it in GitHub Desktop.
select i.id, sum(li.value) as litotal from invoice as i ,line_items as li where li.invoice_id = i.id group by li.invoice_id having litotal > 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment