MySQL Forums
Forum List  »  German

Re: Abfrageproblem - 2 Spalten mit einer Tabelle verknüpfen
Posted by: Hauke Betz
Date: November 21, 2006 01:42AM

--- Hoppla, die Antwort gibt es ja schon, glatt übersehen --- :) :)

Hallo,

versuch es mal mit "LEFT JOIN". In etwa wie folgt:

SELECT
rep.id as repid,
mont1.id as mont1id,
mont2.id as mont2id,
rep.monteur1,
mont1.monteur as mont1name,
rep.monteur2,
mont2.monteur as mont2name
FROM
(`innotest`.`report` as rep
LEFT JOIN monteur as mont1 on rep.monteur1 = mont1.id)
LEFT JOIN
monteur as mont2 on rep.monteur2 = mont2.id;

Gruß,

Hauke



Edited 1 time(s). Last edit at 11/21/2006 01:43AM by Hauke Betz.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Abfrageproblem - 2 Spalten mit einer Tabelle verknüpfen
3261
November 21, 2006 01:42AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.