MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Jerry Schwartz Date:January 12 2007 7:00pm
Subject:RE: Row position in table when sorted?
View as plain text  
Now that I re-read your question, I think your answer is that the LIMIT
clause applies to the set of records retrieved after all of the conditions
are applied. In your example,

SELECT * FROM clients WHERE name LIKE "Mark%" ORDER BY name LIMIT 1, 7;

Then

SELECT * FROM clients WHERE name LIKE "Mark%" ORDER BY name LIMIT 8, 7;

Is that what you were asking?

Have you looked at using the HANDLER statement? That would eliminate the
need to do a SELECT statement for every page, although you'd have to reset
the pointer and still use LIMIT clauses.

It would look something like this:



Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341


> -----Original Message-----
> From: Nuno Oliveira [mailto:dreasi0n.mysql.com@stripped]
> Sent: Friday, January 12, 2007 10:05 AM
> To: mysql@stripped
> Subject: Row position in table when sorted?
>
> Hello,
>
> I'm working on a web site which have a page for the admin
> to browse the clients table in a database.
>
> To facilitate the interaction, I'm ORDERing BY Name...
>
> The pagination buttons in this page are something like:
>
> 	href=".....?Page=7"
>
> and when loaded, it will
>
> 	"SELECT * FROM Clients ORDER BY Name LIMIT 7,1"
>
> This is working perfectly but now I have a problem.
> I've done a page to find a client and I display the
> clients names in a table (Using CSS) but I don't know
> where to link to??? I apply a query and retrieve let's
> say 14 clients that match. What should the LIMIT value???
> This is what I don't know how to do... Please help?
>
> Is there a way to know the position of a certain row if
> all the rows are selected and in a specific order?
>
> Thanks
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/mysql?unsub=1
>
>



Thread
Row position in table when sorted?Nuno Oliveira12 Jan
  • Re: Row position in table when sorted?Rolando Edwards12 Jan
    • Re: Row position in table when sorted?Nuno Oliveira12 Jan
    • Re: Row position in table when sorted?Felix Geerinckx12 Jan
  • RE: Row position in table when sorted?Jerry Schwartz12 Jan
    • Re: Row position in table when sorted?Nuno Oliveira12 Jan
  • Re: Row position in table when sorted?Felix Geerinckx12 Jan