I'm curious if it is possible to do the following
select id from foo where foo.bar = (select SUM(bar) from foo )
without the use of a subquery.
Edit: To clarify, I'm trying to do this with postgresql, which does not appear to support the two solutions posted thus far.
select SUM(bar) from foowill return a single value for the entire table foo. Is this what you are trying to achieve, or is your actual requirement more complicated, and if it is more complicated, can you give us more details?