Group query without losing different records

0

I need help making the following query:

From the permissions table, obtain the user's row without losing data from the action and value column.

Greetings,.

    
asked by sebamim 06.06.2018 в 17:18
source

1 answer

1

Dear, the selection would be like this:

 select usuario, modulo, accion  as accion1, valor, 
 (select a.accion from test.permisos a where a.usuario=t.usuario limit 1,1 ) as accion2 ,
 (select b.valor from test.permisos b where b.usuario=t.usuario limit 1,1  ) as valor2 
 from test.permisos t group by usuario

create a table:

    
answered by 25.07.2018 / 23:37
source