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

From Bruno Wolff III
Subject Re: is this possible? it should be!
Date
Msg-id 20010820074456.A28452@wolff.to
Whole thread Raw
In response to is this possible? it should be!  (newsreader@mediaone.net)
Responses Re: is this possible? it should be!  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-general
On Sun, Aug 19, 2001 at 01:49:00PM -0400,
  newsreader@mediaone.net wrote:
> Hello
>
> I have statements (highly simplified just to get
> the point across) like
>
> select a,b,c from a where d=2 order by e limit 10;
>
> Now I think that because of "order by" the above query
> already "knows" the result of the below query
>
> 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.

Shouldn't:

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


do what you want?

pgsql-general by date:

Previous
From: "Colin 't Hart"
Date:
Subject: Re: Finding database names for overnight vacuum
Next
From: Bruno Wolff III
Date:
Subject: Re: is this possible? it should be!