Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group