On 06-Jul-01 Tom Beidler wrote:
> I have a dealer database with 3000+ records and I'm building a manager to
> sift through the items.
> 
> Currently I ORDER and LIMIT by name so I can come up with names that begin
> with "A" and LIMIT the returns to 25, and then click to see the next 25
> names beginning with "A" etc.
> 
> Now here's where I'm running into problems. I would like to ORDER the 25
> names beginning with "A" by a second parameter. For example, the first 25
> names beginning with "A" are from 12 different states. I'm trying to create
> a query that would find the first 25 names beginning with "A" and ORDER by
> state. 
> 
> Currently my query has only one ORDER so when I try to ORDER by state I get
> the first 25 records listed by state.
> 
> Here's the query;
> 
> SELECT id, name, state, country, status FROM dealer WHERE name LIKE "A%"
> ORDER BY name LIMIT 0, 25;
> 
> I've also tried;
> 
> SELECT id, name, state, country, status FROM dealer WHERE name LIKE "A%"
> ORDER BY name, state LIMIT 0, 25
> 
> But that didn't work.
> 

hmmm. it didn't work ? 

Well, sometimes my car won't work (and it doesn't have the decency to 
give an error message).

try ORDER BY country, state, name.

Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to