Don't forget LIMIT 0,25 ("I want to select about 25 rows from a table...")

SELECT * FROM mytable ORDER BY series,price LIMIT 0,25

Mike

Rick Emery wrote:

>SELECT * FROM mytable ORDER BY series,price;
>
>
>-----Original Message-----
>From: René Fournier [mailto:[EMAIL PROTECTED]]
>Sent: Monday, December 03, 2001 4:27 PM
>To: [EMAIL PROTECTED]
>Subject: MySQL ORDER BY or PHP Sort?
>
>
>I want to select about 25 rows from a table, and sort them by two 
>criteria. First, by each row's Series field ("Baby", "Genesis", "Super", 
>"Predator", "Millennium" are the various Series, and the order I'd like 
>the rows in the array). Within each Series, I'd like the rows sorted by 
>their Price field, ascending. For example:
>
>Baby $5
>Baby $10
>Baby $15
>Genesis $20
>Genesis $35
>Genesis $50
>
>...and so on.
>
>Now, I know how to structure my MySQL Select statment such that the rows 
>it pulls from the table will be either sorted by Price OR by Series, but 
>not both, in the way I'd like. Does anyone know if it's possibly to do 
>this in the Select statement itself? (I'd rather do it that way, than 
>resort in PHP.)
>
>Thanks!
>
>...Rene
>
>---
>René Fournier
>[EMAIL PROTECTED]
>
>
>---------------------------------------------------------------------
>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
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to