Bernd1984
Kastenbrot
Hallo,
das mit dem Left Join ist ja auch ok.
das mit dem Left Join ist ja auch ok.
Das meine ich ja mitHuRaHoRRe hat gesagt.:Nur weis ich jetzt gerade nicht wie du das genau auslesen kannst, da branche ja jetzt 3 verschiedene Werte hat.
So meinte ich es:Bernd1984 hat gesagt.:Du musst 3x auf die Branche joinen.

Code:
SELECT fname, bid1, $tab_branchen_1.branche AS branche1,
$tab_branchen_2.branche AS branche2,
$tab_branchen_3.branche AS branche3
FROM $tab_firmen
LEFT JOIN $tab_branchen $tab_branchen_1 ON ($tab_firmen.bid1 = $tab_branchen_1.id)
LEFT JOIN $tab_branchen $tab_branchen_2 ON ($tab_firmen.bid2 = $tab_branchen_2.id)
LEFT JOIN $tab_branchen $tab_branchen_3 ON ($tab_firmen.bid3 = $tab_branchen_3.id)