0
我想顯示的平均分數,但即使代碼被執行其沒有得到顯示,這裏是我的代碼:無法顯示平均
set serveroutput on size 10000;
declare
s_student_id grade.student_id%type;
g_score grade.score%type;
begin
for c in (select distinct grade.student_id, avg(grade.score) into s_student_id, g_score from grade inner join class on grade.class_id = class.class_id group by grade.student_id having count(class.course_id) > 4)
loop
dbms_output.put_line('Student' || c.student_id || ' :' || g_score);
end loop;
exception
when no_data_found then dbms_output.put_line('There are no students who selected more than 4 courses');
end;
/
輸出:
anonymous block completed
Student1 :
如果直接針對數據運行查詢,您會得到什麼結果? – FJT
我得到的輸出: 73 –