Re: is this possible? it should be! - Mailing list pgsql-general

From reina@nsi.edu (Tony Reina)
Subject Re: is this possible? it should be!
Date
Msg-id f40d3195.0108201556.60c4fe39@posting.google.com
Whole thread Raw
In response to is this possible? it should be!  (newsreader@mediaone.net)
Responses Re: Re: is this possible? it should be!  (newsreader@mediaone.net)
List pgsql-general
> select a,b,c from a where d=2 order by e limit 10;
> select count(*) from a where d=2;
>
> The point is that I want to know the total number
> of matches and I also want to use "limit".  And
> I don't want to do two queries.
>

Perhaps GROUP BY will get you where you want to go:

select count(*), a, b, c from a where d=2 group by a, b, c order by e limit 10;


-Tony

pgsql-general by date:

Previous
From: "Robert J. Sanford, Jr."
Date:
Subject: clustering and/or failover?
Next
From: missive@frontiernet.net (Lee Harr)
Date:
Subject: Re: Missing Sequence File