sql statement - complex order by
| From: | Bryan | Date: | Mon, 02 Jul 2007 19:34:35 +0000 |
| Subject: | sql statement - complex order by | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-43731@lists.php.net to get a copy of this message | ||
SELECT * FROM productgroup WHERE groupid = $productid
AND label = 'Cats' ORDER BY title
SELECT * FROM productgroup WHERE groupid = $productid
AND label != 'Cats' ORDER BY label,title
I'd like to find a way to combine these 2 statements. I want to list out all the products, ordered by title but listing out all the Cats products first. Any way to do that without having separate statements?
Thanks...