List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:October 2 2001 3:52pm
Subject:Re: Order By & Limit; Count
View as plain text  
At 11:48 AM -0300 10/2/01, Ashwin Kutty wrote:
>Hi,
>
>I have been using the ORDER By clause in one of my sql queries and 
>it works fine; however when I combine it with a LIMIT it still 
>order's the results by it doesn't do it the way its supposed to, for 
>example:-

Your examples don't show the actual queries you're using, so it's difficult
to say whether or not they're working correctly.

>
>Order By clause without Limit returns:-
>A
>B
>C
>C
>C
>C
>C
>C
>M
>N
>T
>W
>
>Order By clause with Limit returns:-
>
>C
>C
>C
>C
>C
>C
>M
>N
>T
>W
>
>Is there any way to fix this, so that the results with the limit 
>comes out starting with the A and then moves on to the next pages?
>
>Also, can I add a count(*) in my sql statement to get the total 
>number of records even though I would be using Limit? I tried 
>something along the lines of:-
>SELECT *, COUNT(*) from table where column like keyword order by 
>title desc limit 0,10; and that dint work, so any ideas?

You'll be able to do this in MySQL 4.0.



-- 
Paul DuBois, paul@stripped
Thread
Order By & Limit; CountAshwin Kutty2 Oct
  • Re: Order By & Limit; CountPaul DuBois2 Oct
  • AW: Order By & Limit; CountChristian Sage3 Oct
    • Re: AW: Order By & Limit; CountAshwin Kutty3 Oct
      • Re: AW: Order By & Limit; CountCarl Troein3 Oct
    • Re: AW: Order By & Limit; CountAshwin Kutty3 Oct
    • Re: AW: Order By & Limit; Countkarel pitra5 Oct
    • Re: AW: Order By & Limit; CountAshwin Kutty5 Oct