* Paul DuBois > At 18:03 +0200 4/6/02, David yahoo wrote: > > Is there any way to put a sort order different than the > > alpahbetical order in string. > > > >A thing like that order "french","german" .... > > > ORDER BY ELT(language,'english','german','french'),Linkname ASC
Maybe you meant FIELD(language...? >From the manual: Changes in release 3.20.17 -------------------------- [...] * The `ELT()' function is renamed to `FIELD()'. The new `ELT()' function returns a value based on an index: `FIELD()' is the inverse of `ELT()' Example: `ELT(2,"A","B","C")' returns `"B"'. `FIELD("B","A","B","C")' returns `2'. The language column is a string containing 'english', 'french' or 'german'. The order of the fields in the FIELD() should be the order of what you want as a result: 'french','german','english' will give you 'french' items first, 'english' items last. Beware that any item with a language not existing in the field list will get a zero value, and be sorted first. -- Roger query --------------------------------------------------------------------- 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