Harald Fuchs wrote:

ORDER BY name = "Others", name;

As a more generic alternative, consider adding a smallint 'extrasort' column (default 0), then you simply assign extrasort -1 (or more) to force things near the top and 1 (or more) to artificially put things at the bottom (depending on sort order).

ALTER TABLE mytable ADD extrasort tinyint not null default 0;
UPDATE mytable SET extrasort = 1 WHERE name = "Others";
SELECT id, name FROM mytable ORDER BY extrasort, name;

This is very generic and can be used on any table where you want to force certain objects to the top of a sort list easily (and, more importantly, is changable without changing your queries).

<rant>As for spam filters, evidently the above does not contain SQL or QUERY.
It does, however, contain "ALTER TABLE", "QUERIES" and "SMALLINT", none
of which would occur outside a SQL related list with any frequency. Please
update the stupid spam filter to include these terms, at a minimum, even
if they aren't advertised in the "your message must contain ... " clause.</rant>

--
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



---------------------------------------------------------------------
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