select SUBSTRING_INDEX(identifier, '-', 1) AS myorder, identifier from schiffe where ( ( (fn_klassenname regexp '.*16%20[Kk][Rr].*' OR fn_klasse_name regexp '.*16%20[Kk][Rr].*' OR fn_klasse_bezeichnung regexp '.*16%20[Kk][Rr].*' OR fn_klasse_typ regexp '.*16%20[Kk][Rr].*' ) ) AND identifier like '%schiffe%' AND fn_registername = 'rky' ) ORDER BY myorder, fn_registername, fn_klassenname, fn_name, fn_segelnummer, fn_baujahr 0select SUBSTRING_INDEX(identifier, '-', 1) AS myorder, identifier from schiffe WHERE (fn_klassenname regexp '.*7%20[Kk][Rr].*' OR fn_klasse_name regexp '.*7%20[Kk][Rr].*' OR fn_klasse_bezeichnung regexp '.*7%20[Kk][Rr].*' OR fn_klasse_typ regexp '.*7%20[Kk][Rr].*' ) Fertch