Skip to content

Instantly share code, notes, and snippets.

@shofetim
Created May 20, 2013 19:26
Show Gist options
  • Select an option

  • Save shofetim/5614779 to your computer and use it in GitHub Desktop.

Select an option

Save shofetim/5614779 to your computer and use it in GitHub Desktop.
SELECT
t1.a -- I need all of these
SUM(t2.b) --but only sum these of t2.c = TRUE
WHERE
t2.c = TRUE
@shofetim
Copy link
Copy Markdown
Author

What I have been able to come up with only returns the t1.a where t2.c is TRUE. The real SQL is alot harrier, and slower...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment