Re: count() for a select statement? - Mailing list pgsql-general

From Stephan Szabo
Subject Re: count() for a select statement?
Date
Msg-id 20021001110711.D95989-100000@megazone23.bigpanda.com
Whole thread Raw
In response to count() for a select statement?  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
List pgsql-general
On Wed, 2 Oct 2002, Jean-Christian Imbeault wrote:

> Is there an efficient way to get a count of the number of rows returned
> by this kind of query?
>
> select id from products where name ILIKE 'TNT' UNION select id from
> products where name ILIKE 'ATOM' UNION select id from products where
> name ILIKE 'BOB'

Probably "select count(*) from (select id from ... ) as t"
should work.


pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: cluster replication with intermezzo
Next
From: snpe
Date:
Subject: Re: count() for a select statement?