Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ORDER BY DESC LIMIT Question

    ORDER BY .... DESC LIMIT 4

    I understand how this works. It returns the last, in this case 4, whatevers. Is there a way to get the next to the last 4? In other words, in a table that has 100 rows, could this be written to return rows 93-96, instead of 97-100. This is a dynamic table, where the row numbers are incremented as more information is added.

    Thanks,
    Stan

  • #2
    New to the CF scene
    Join Date
    Jul 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I found my answer, I just hadn't looked enough. The solution to my question is:

    DESC LIMIT 4, 4

    For others that may be looking for help, this example returns 4 whatevers, starting 4 from the last. The first 4 (after DESC LIMIT) is the number to return. The second 4 is the starting point.

    Stan


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •