MySQL Forums
Forum List  »  German

Re: Zwei Spalten mit einer verknüpfen
Posted by: Maximilian Schmid
Date: November 06, 2019 06:54AM

Ich habe selbst eine Lösung gefunden:

SELECT messages.fromuid AS fromuid,
messages.touid AS touid,
u1.username AS fromuser,
u2.username AS touser
FROM messages
INNER JOIN users u1 ON u1.uid = messages.fromuid
INNER JOIN users u2 ON u2.uid = messages.touid
WHERE messages.touid = 1 OR messages.fromuid = 1

Options: ReplyQuote

Written By
Re: Zwei Spalten mit einer verknüpfen
November 06, 2019 06:54AM

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.