List:General Discussion« Previous MessageNext Message »
From:Ashwin Kutty Date:October 2 2001 2:48pm
Subject:Order By & Limit; Count
View as plain text  
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:-

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?

Thanks..






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