I have three Tables.
table1 = anlass table2 = stammdaten_beziehungen table3 = parameter_zuweisungen_anl
It gaves me this ERROR: Subquery returns more than 1 row
But what i need, is all 'BeziehKuBez' Comma separated in one column.
eg. Beziehname1, Beziehname2, ...
If have test it with, CONCAT_WS(',', BeziehKuBez)
. But give me the same one. Could I do this with a while loop? But I dont know how?!
.:: UPDATE ::. thx, Greg. But...
GROUP_CONCAT() --> The same output like concat(). Only one name per "Anlass". But i need, Multiple names comma separated for one "Anlass".
mhmm... Sitting on this Problem since yesterday ;) I will have weekend...
.:: TABLE STRUCTURE ::.
Table Anlass:
AnlID, anlass_name
*Table Stammdaten_beziehungen*
BeziehID, Beziehkubez
*Table Parameter_zuweisung_anl*
ZuwAnlID, ZuwAnlAnlNr,ZuwAnlBeziehID
INFO ZuwAnlAnlNr linked to Anlass.AnlID ZuwAnlBeziehID linked to Beziehung.BeziehID
This is my query:
SELECT CONCAT(`BeziehKuBez`) AS Bezname
FROM `stammdaten_beziehungen` AS Beziehung, `anlass` AS anlass
INNER JOIN `parameter_zuweisungen_anl`
ON Beziehung.BeziehID = parameter_zuweisungen_anl.ZuwAnlBeziehID
WHERE ZuwAnlAnlNr = Anlass.AnlID