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?