MySQL Forums
Forum List  »  German

Re: [Hilfe] bei einer SQL Abfrage benötigt
Posted by: Katja Kahl
Date: December 04, 2014 02:24AM

Hallo Bastian,
schau mal nach der Funktion group_concat(), deine Abfrage könnte ungefähr so aussehen:
SELECT t1.id, t1.name, t1.artefakt, t2.eintrag, t2.tag, t2.ctime, group_concat(t3.keyword)
from tabelle1 as t1
join tabelle2 as t2 on t1.artefakt = t2.artefakt
join tabelle3 as t3 on t2.tag = t3.tag
group by t1.id;


Wenn es Daten in Tabelle2 gibt, zu denen es keine Daten in Tabelle3 gibt, musst du statt join tabelle3 ein left join tabelle3 verwenden.

Gruß Katja

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: [Hilfe] bei einer SQL Abfrage benötigt
614
December 04, 2014 02:24AM


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.