On Mon, Aug 4, 2008 at 2:08 PM, Rajarshi Guha <[EMAIL PROTECTED]> wrote:

> select count(aid) where cid = 123 and cid = 456;
>
> but I was wondering whether I could construct a single SQL statement to do
> this.
>
> Any pointers would be appreciated,

Typed into gmail, so may need some tweaking, but something to the effect of:

select count(*) from table a inner join table b on a.aid=b.bid group
by a.cid,b.cid;

should do the trick, I'd think...

-- 
- David T. Wilson
[EMAIL PROTECTED]

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to