Remove Group_Concat and list each one separately

0

I want to remove group_concat to list each one separately, any tips?

SELECT
   U.login, 
   (SELECT Group_concat(AC.curso ORDER BY id ASC) 
    FROM   alunos_cursos AC 
           LEFT JOIN cursos C 
                  ON AC.curso = C.id 
    WHERE  AC.aluno = U.id 
           AND AC.disponivel = 1 


     AND AC.curso <> 9) CURSOS 
FROM   usuarios U 
Where NIVEL_ACESSO=0

Example:

From

 LOGIN   CURSOS
    1     100, 112, 12, 43, 3
    2     9, 25, 6, 78, 44, 70

To

  LOGIN   CURSOS
    1     100
    1     112
    1     12
    1     43
    1     3
    2     9
    2     25
    [...]
    
asked by anonymous 20.09.2018 / 13:56

1 answer

1
SELECT U.login,
      AC.course
  FROM users U
  INNER JOIN students_courses AC ON AC.student = U.id
  LEFT JOIN courses C ON AC.course= C.id
WHERE level_access = 0
  AND AC.avaliable = 1
  AND AC.course <> 9
ORDER BY U.login
    
20.09.2018 / 14:16