"kakerjak" <kakarotto(at)canada(dot)com> writes:
> If the subquery is placed before the JOIN, like it is above, then the error
> i get says 'parse error at or near "select"'
> If i flip the subquery around with the laboratory table then i get 'parse
> error at or near "("'
Are you using 7.1?
regards, tom lane