以下是往年抽hkcee的成績的sql,請問是否可以抽hkdse的成績。 SELECT b.examcode, b.examyear, a.classcode, a.classno, a.regno, a.enname, a.chname, a.sex, b.subjcode, '' AS 'componentno', c.engabrname, c.chiabrname, b.grade, b.gradeval FROM TB_STU_STUDENT a JOIN TB_HKE_ENTRYSUBJ b ON a.stuid=b.stuid JOIN TB_HKE_SUBJECT c ON b.subjcode=c.subjcode WHERE b.examcode='C' AND b.examyear=2010 AND c.examyear=2010 UNION SELECT b.examcode, b.examyear, a.classcode, a.classno, a.regno, a.enname, a.chname, a.sex, b.subjcode, componentno, c.engabrname, c.chiabrname, b.grade, b.gradeval FROM TB_STU_STUDENT a JOIN TB_HKE_ENTRYCOMPONENT b ON a.stuid=b.stuid JOIN TB_HKE_SUBJECT c ON b.subjcode=c.subjcode WHERE b.examcode='C' AND b.examyear=2010 AND c.examyear=2010 ORDER BY 1,2,3,4,9,10
老師請參考以下的 SQL 語句。 select a.EXAMCODE, a.examyear, a.classcode, a.classno, a1.regno, a1.ENNAME, a1.CHNAME, a1.sex, b.subjcode 'Subject Code', b1.DSESUBJGROUPNAME_ENG||' ('||b1.DSESUBJGROUPNAME_CHI||')' 'Subject Name', b.subjgrdlvl 'Subject Grade', c.subjcompcode 'Subject Comp Code', (case when c1.dsesubjcompname_eng is null then '' else c1.dsesubjcompname_eng||' ('||c1.dsesubjcompname_chi||')' end) 'Subject Comp Name', c.subjcompgrdlvl 'Subject Comp Grade' from tb_hke_dsecandinfo a left outer join tb_stu_student a1 on a.suid=a1.suid and a.stuid=a1.stuid left outer join tb_hke_dsesubjresult b on a.suid=b.suid and a.schcode=b.schcode and a.candno=b.candno and a.examyear=b.examyear left outer join (select distinct SUID, EXAMYEAR, EXAMCODE, DSESUBJGROUPCODE, DSESUBJGROUPNAME_ENG, DSESUBJGROUPNAME_CHI from tb_hke_regexamsubjgrp group by SUID, EXAMYEAR, EXAMCODE, DSESUBJGROUPCODE, DSESUBJGROUPNAME_ENG, DSESUBJGROUPNAME_CHI) b1 on b.suid=b1.suid and b.examyear=b1.examyear and b1.examcode='DSE' and b.subjcode=b1.DSESUBJGROUPCODE left outer join tb_hke_dsesubjcompresult c on b.suid=c.suid and b.schcode=c.schcode and b.candno=c.candno and b.examyear=c.examyear and b.subjcode=c.subjcode left outer join tb_hke_regexamsubjcomp c1 on c.suid=c1.suid and c.examyear=c1.examyear and c1.examcode='DSE' and c1.dsesubjcomptype='RESULT' and c.subjcode=c1.dsesubjgroupcode and c.subjcompcode=c1.dsesubjcompcode where a.examyear=? order by 1,2,3,4,9,12
敢問語文分卷的等級會否如上載檔案般呢? 謝謝! http://www.hkedcity.net/citizen_files/aa/sr/tr-vc1083/public_html/2012_QueryResult.xls Miss Chung