給定學生表以下mysql
create table student id int primary key, name varchar(11), course varchar(11), score int
請用一條sql查出 >80分的科目列表,且用一行記錄展現sql
SELECT name AS studentName, JSON_ARRAYAGG(course) AS courseNameList FROM student WHERE score > 80 GROUP BY studentName;
https://database.guide/json_arrayagg-create-a-json-array-from-the-rows-of-a-query-in-mysql/json