1
這裏的Oracle查詢是我的表[答案]和[student_answer]與多輸出
create table answer(
varchar2(10) ques_id,
varchar2(10) ans,
primary key (ques_id)
);
create table student_answer(
varchar2(10) stud_id,
varchar2(10) quiz_id,
varchar2(10) ques_id,
varchar2(10) ans,
number(3) mark,
primary key (stud_id,quiz_id,ques_id)
);
UPDATE student_answer
SET mark = 1
WHERE * IN (select ques_id, stud_id, quiz_id from answer m
right outer join student_answer sa
on (sa.ques_id = m.ques_id and sa.ans=m.ans)
where m.ques_id is not null
order by sa.ques_id);
*我來到這裏混淆
我怎樣才能得到每個子查詢多行輸出?以便我可以根據結果更新表格?
* every student have different id
* every quiz have different id
* every question have different id