Concatenate values from the same field

1

I have a query that brings me this data, as you can see it brings me the same tasks because it has 2 users that handle it, I want you to help me concatenate it

So that it is like this other and so reduce me the records that do not need to bring

Here I have part of the query where I guess I should do the concatenation I'm using MySQL

select  
B.bandeja
,a.bandejaTareaId as TareaID
,A.userid as 'Usuario Reporta'
,E.username as 'Usuario Bandeja'
,A.inicio
    
asked by psy 10.04.2018 в 18:51
source

3 answers

1

You could group by Task ID:

select group_concat(e.username) AS 'Usuario Bandeja' 
from tablas
group by TareaID
    
answered by 10.04.2018 / 18:58
source
0

You can use this function CONCAT() :

SELECT CONCAT("SQL ", "Tutorial ", "is ", "fun!") AS ConcatenatedString;

Reference.

    
answered by 10.04.2018 в 18:58
0

You can group it by Task ID. Example:

"SELECT B.bandeja ,a.bandejaTareaId as TareaID ,A.userid as 'Usuario Reporta' , GROUP_CONCAT(E.username) AS 'Usuario Bandeja', A.inicio
FROM table
GROUP BY a.bandejaTareaId"
    
answered by 10.04.2018 в 19:01