Re: Subquery and where clause ?

From: Bo Lorentsen <bl(at)netgroup(dot)dk>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Subquery and where clause ?
Date: 2001-08-22 12:34:58
Message-ID: 3B83A6F2.B727AF03@netgroup.dk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Bo Lorentsen wrote:

> SELECT C.id, A.count, B.count FROM C,
> (SELECT COUNT( A.id ) FROM A WHERE A.ref = C.id) AS A,
> (SELECT COUNT( B.id ) FROM B WHERE B.ref = C.id) AS B;

Arhh, the answer is simple, dont do this in the FROM clause ! :-)

/BL

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Bo Lorentsen 2001-08-22 13:02:45 Boolean SQL function ?
Previous Message Bo Lorentsen 2001-08-22 12:18:53 Subquery and where clause ?