Re: trivial sql help - Mailing list pgsql-general

From Joe Conway
Subject Re: trivial sql help
Date
Msg-id 3DA5A6EC.9040906@joeconway.com
Whole thread Raw
In response to trivial sql help  (Patrick Welche <prlw1@newn.cam.ac.uk>)
Responses Re: trivial sql help  (Patrick Welche <prlw1@newn.cam.ac.uk>)
List pgsql-general
Patrick Welche wrote:
>  333 |     1
> (18 rows)
>
> update rawrequest
>    set cid=(

> select pc.c
>   from pers_comp as pc
>  where pc.p=pid
>  group by pc.c
> having count(pc.c)=1
>            )
>  where pr
> ;
>
> ERROR:  More than one tuple returned by a subselect used as an expression.

Well, the same query above *does* return more than one row (18 in fact). I
think you need to qualify the sub-select a bit more, but without more details
on your schema, it is hard to guess how.

Joe


pgsql-general by date:

Previous
From: "Erwan DUROSELLE"
Date:
Subject: Rép. : Re: access time performance problem
Next
From: Stephan Szabo
Date:
Subject: Re: trivial sql help