Re: Retreving count of rows returned by a join query

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: pgsql-novice(at)postgresql(dot)org
Cc: "Jasbinder Singh Bali" <jsbali(at)gmail(dot)com>, "Phillip Smith" <phillip(dot)smith(at)weatherbeeta(dot)com(dot)au>
Subject: Re: Retreving count of rows returned by a join query
Date: 2007-05-31 10:08:08
Message-ID: 200705310608.09170.sdavis2@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Thursday 31 May 2007 05:17, Jasbinder Singh Bali wrote:
> with count(*) i want other rows as well
> something like
>
> select count(*) , a.3 from a, b where a.3 = b.3;

That would require two queries unless you want to use subqueries:

select count(*) from a,b where a.3=b.3;

select a.3 from a,b where a.3=b.3;

Sean

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Raimon Fernandez 2007-05-31 10:19:08 lock row outside transaction, if not ...
Previous Message Phillip Smith 2007-05-31 09:33:39 Re: Retreving count of rows returned by a join query