Giriş
GROUP_CONCAT ile birden fazla satırı birleştirebiliriz.
Örnek
Şöyle yaparız
GROUP_CONCAT( DISTINCT CONCAT(tags.id,',',tags.displayName) ORDER BY posts.id SEPARATOR ';' )
Örnek
Şöyle yaparız
SELECT employeeNumber, firstName, lastName,( SELECT GROUP_CONCAT(DISTINCT CONCAT(firstName,lastName,employeeNumber) SEPARATOR ',')FROM employees) AS concattedFROM employeesINNER JOINcustomers ON customers.salesRepEmployeeNumber = employeeNumberGROUP BY employeeNumberORDER BY firstName , lastname;
Hiç yorum yok:
Yorum Gönder