Hallo, Am Mon, 20 Oct 2003, Al Bogner schrieb:
Das einzige was mich noch stört, ist, dass die Sortierung zuerst Großbuchstaben sortiert.
Hm. Komisch. Bei mir passiert genau das nicht... $ mysqladmin -p variables | language | /usr/share/mysql/english/ | | version | 3.22.32 | [..]
Über Hinweise, wie man so etwas performanter lösen kann, freue ich mich natürlich.
Du kannst mit CONCAT eine beliebig lange Liste von Komma-getrennten Feldern, Strings und sonstwas aneinanderfuegen. Und das ganze uebersichtlicher schreiben... Ich hoffe mal, ich hab's richtig hinbekommen ;) UPDATE basis SET listinfo = concat( if( tel_nr=0, "", # else: es gibt ne Tel-Nr concat( if( tel_ovw=89, # Ortsvorwahl Muenchen concat( replace( format( tel_nr, 0 ), ",", "." ), if( tel_dw="", "", concat( "-", tel_dw) ) ), # else: (Ortsvorwahl != Muenchen) concat( if( tel_lvw=49, # DE? "0", concat( "00", tel_lvw, "-" ) ), tel_ovw, "-", replace( format( tel_nr, 0), ",", "." ), if( tel_dw=0, '', concat( "-", tel_dw ) ) ) ), # end if tel_ovw=89 ";" ) # end else: concat ), # end if tel_nr=0 if( ort="", "", concat( land, "-", plz, " ", ort, if( strasse="", "", concat( ", ", strasse ) ), ";" ) ), if( geb='0000-00-00', '', concat( " ", date_format( geb, '%e.%c.%y' ), " (", round( (to_days(curdate()) - to_days(geb) ) / 365, 1 ), "J.), ", left( dayname( concat( year(curdate()), "-", month(geb), "-", dayofmonth(geb) ) ), 3 ), # end left " in ", date_format( curdate(), '%y' ) ) # end concat: else (geb!=0) ), # end if geb=0 if( firma="", "", # else: firma != "" concat( " | ", firma, if( tel_nr_fa=0, "", # else: tel_nr_fa != 0 if( tel_ovw_fa=89, concat( " ", replace(format(tel_nr_fa,0),",","."), if( tel_dw_fa="", "", concat( "-", tel_dw_fa) ) ), # else: tel_ovw_fa != 89 concat( if( tel_lvw_fa = 49, " 0", concat( "00", tel_lvw_fa, "-" ) ), tel_ovw_fa, "-", replace(format(tel_nr_fa,0),",","."), if( tel_dw_fa=0, '', concat( "-", tel_dw_fa ) ) ) # end concat: else (tel_owv!=89) ) # end if: tel_ovw_fa=89 ) # end if: tel_nr_fa=0 ) # end concat: else (firma!="") ) # end if: firma="" ); # end concat Wenn du nachzaehlst, siehst du, dass ein Haufen 'concat' rausgeflogen sind ;) Merkregel: ein 'concat ( concat ( ... ) )' ist ueberfluessig. HTH, -dnh --
Du tust ja fast so, als gäbe es etwas, das bei Redhat _nicht_ nach hinten losgeht!? .forward ? [Matthias Kabel zu Felix von Leitner in dasr]