I've changed my query to:

$order = "SUBSTRING_INDEX(objektname,'-',1)";
$order .=
",RIGHT(objektname,(LENGTH(objektname)-LOCATE('-',objektname)))";

so that the syntax ist okay, and the tests too:
mySQL returns the correct values:

objekt   SUBSTRING_INDEX(objekt,'-',1)  LENGTH(objekt)
LOCATE('-',objekt)  RIGHT(...)
MD1-1234                MD1                                     8
4               1234
MD1-32          MD1                                     6
4               32
SD1-1           SD1                                     5
4               1

But the search-results are not ordered corectly. Perhaps i can transform
the numbers int integer? I think they are handled as string...

Greetings,
Jürgen


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