Mysql – concatenate two columns into one

MySQL

I am using Oracle SQL Developer and am trying to concatenate two columns into one for each row of students. Under pivot below, I have "1" and "1A" separately but would like to show both into one column.

SELECT
  *
FROM (
    SELECT
      students.student_number   id
     ,students.last_name ||',' ||students.first_name student
     ,students.grade_level      gr
     ,sections.external_expression
     ,teachers.last_name        class
    FROM cc
      JOIN sections ON cc.sectionid   = sections.id
      JOIN courses ON sections.course_number   = courses.course_number
      JOIN teachers ON sections.teacher   = teachers.id
      JOIN students ON cc.studentid   = students.id
    WHERE
      SYSDATE BETWEEN cc.dateenrolled AND cc.dateleft
      AND cc.schoolid         = sections.schoolid
      AND sections.schoolid   = '300'
  )
    PIVOT (
      LISTAGG ( class,'/' ) WITHIN GROUP ( ORDER BY class )
      FOR external_expression
      IN ( '1A(A) 1B(A)' "1",'1A-2A(A)' "1A",'2A(A) 2B(A)' "2"
          ,'1B-2B(A)' "2A",'3A(A) 3B(A)' "3",'4A(A) 4B(A)' "4"
          ,'5A-5B(A)' "5",'5A(A) 7A(A)' "5A",'7A-7B(A)' "7"
          ,'5B(A) 7B(A)' "7A",'8A(A)' "8",'9A(A)' "9",'10A(A)' "10" )
    )
ORDER BY student

Best Answer

CONCAT for string concatination.

Note: PIVOT, SYSDATE also isn't a syntax in MySQL

MariaDB-10.3 has an ORACLE MODE which might make your transition easier.