Tom Lane <tgl@sss.pgh.pa.us> writes:
> Greg Stark <gsstark@mit.edu> writes:
> > slo=> explain
> > select *
> > from (select foo_id,count(*) as n from foo_bar group by foo_id) as x
> > join (select * from foo limit 1) as foo using (foo_id)
> > ;
>
> Why not put the subselect in the output list, if that's the kind of plan
> you want?
Actually that's the way the query is right now. The problem arises because I
want to add a second column without duplicating the whole thing.
--
greg