111,126
社区成员
发帖
与我相关
我的任务
分享
select studid,courid,reupflag,archment into #tmp0 from g_grade
update #tmp0 set archment='0' where archment='缺考' or archment='不及格' or archment='缓考' or archment='作弊'
update #tmp0 set archment='60' where archment='优' or archment='良' or archment='中' or archment='及格'
select studid,courid,cast(archment as float) as archment into #tmp3 from #tmp0
select distinct studid,courid,archment into #tmp4 from #tmp3 as a where not exists (select b.* from #tmp3 as b where a.studid=b.studid and a.courid=b.courid and a.archment<b.archment)
order by a.studid
select a.classname,a.studid,a.studname,b.courid,b.courname,b.courcredit,c.archment into #tmp5 from #tmp4 as c,e_student as a,r_course as b
where a.studid=c.studid and b.courid=c.courid and a.classname like 'KT5%' and c.archment<60
order by b.courid
select a.classname,a.studid,a.studname,b.courid,b.courname,b.courcredit,c.archment into #tmp6 from #tmp4 as c,e_student as a,r_course as b
where a.studid=c.studid and b.courid=c.courid and a.classname like 'KT654%' and c.archment<60
order by b.courid
select * from #tmp6 where not exists
(
select * from r_course where r_course.courid= #tmp6.courid and r_course.courid like '00%'
)
select * from #tmp5 where not exists
(
select * from r_course where r_course.courid= #tmp5.courid and r_course.courid like '00%'
)
dr["archment"].tostring()