当前位置:编程学习 > C#/ASP.NET >>

高手过来看看

用sql语句实现


考试科目(A)       学生成绩表(B)                      学生名册表(C)    
科目ID  科目名           科目ID         学号   得分        学号   姓名     班級 
 1       语文                    2             A01      90         A01     张三     A班
 2       数学                    1             B01      80         B01     李四     B班
 3       英语                    3             B01      70         A02     王二     A班
                                          1             A01      55         C01     麻子     C班

                                           …                    …            …                …           …        …

根据上述表得出下面内容,只计算所有参考的学生(格式下的内容是假设的) 
班级       语文(平均分)  语文(不及格率) 数学(平均分)  数学(不及格率)   英语(平均分)  英语(不及格率)
A班      80            10%            75              25%           74.5          30%
…        …            …              …             …             …           …
--------------------编程问答-------------------- --------------------编程问答-------------------- 能解决上面问题,需要找工作的同仁,请联系我

联系方式:dfliu2009@163.com
工作地点:深圳关外
--------------------编程问答-------------------- 没有人关注呀 --------------------编程问答-------------------- 学习!!!!!!!!!!!11 --------------------编程问答-------------------- 顶顶顶顶顶顶顶 --------------------编程问答-------------------- drop table #tempcount
drop table #tempcountAll

select avg(score) as scoreAVG,count(score) as countsALL into #tempcountAll from scores as a ,students as b where a.studentid=b.studentid and b.class='A' and a.coureseid=(select courseid from courses where coursetitle='数学')
select count(score) as Counts into #tempCount from scores as a ,students as b  where a.studentid=b.studentid and a.coureseid=(select courseid from courses where coursetitle='数学') and a.score<60
select  a.scoreAVG as '数学平均分',case when b.counts=0 then  rtrim(convert(nchar,a.countsall/a.countsall*100))+'%' else rtrim(convert(nchar,b.counts/a.countsall*100))+'%' end as '数学及格率' from #tempcountall as a,#tempcount as b --------------------编程问答-------------------- 这个是执行后的结果,其他科目一样。
--------------------编程问答--------------------
引用 6 楼 tosp2012 的回复:
drop table #tempcount
drop table #tempcountAll

select avg(score) as scoreAVG,count(score) as countsALL into #tempcountAll from scores as a ,students as b where a.studentid=b.studentid and b.class=……

方法不错,顶 --------------------编程问答-------------------- 方法不错,顶 --------------------编程问答--------------------
引用 6 楼 tosp2012 的回复:
drop table #tempcount
drop table #tempcountAll

select avg(score) as scoreAVG,count(score) as countsALL into #tempcountAll from scores as a ,students as b where a.studentid=b.studentid and b.class=……


嗯,不錯!學習啦。 --------------------编程问答-------------------- 招人,想法挺好的,呵呵 --------------------编程问答-------------------- 要我就分开来一步步做,一个个算,还弄个滚动条不停的滚,百分比不停的跑。 --------------------编程问答-------------------- 呵呵,感谢大家的关注,有哪位同仁想找工作的,记得联系我呀 --------------------编程问答-------------------- 哈哈,2搂招聘啥职位呀!有什么要求呢。 --------------------编程问答-------------------- 呵呵,支持. --------------------编程问答-------------------- 我将相关的解决方法发到你邮箱了.呵呵 --------------------编程问答-------------------- --------------------编程问答--------------------
引用 17 楼 dfliu2009 的回复:
招聘要求
1.专科以上,1年以上实际工厂工作经验
2.精通Crystal Report 8.5或以上
3.精通SQL Server 2000
4.精通VB.net或以上
5.有ERP系统开发工作经验,会水晶报表,有良好的编程习惯


呵呵,待遇怎么样?
关注。。。 --------------------编程问答-------------------- 待遇是面议的,应该在3-4K左右,公司包住,吃饭在饭堂吃,5块一餐 --------------------编程问答-------------------- 学习了,顶 --------------------编程问答--------------------
引用 19 楼 dfliu2009 的回复:
待遇是面议的,应该在3-4K左右,公司包住,吃饭在饭堂吃,5块一餐

不瞒你说,我外块都有3K --------------------编程问答-------------------- 呵呵,楼上的生财有道啊 --------------------编程问答-------------------- 顶起来呀,要找工作的联系我呀 --------------------编程问答-------------------- --------------------编程问答-------------------- 还没有找到合适人啊 --------------------编程问答--------------------
引用 18 楼 tosp2012 的回复:
引用 17 楼 dfliu2009 的回复:
招聘要求
1.专科以上,1年以上实际工厂工作经验
2.精通Crystal Report 8.5或以上
3.精通SQL Server 2000
4.精通VB.net或以上
5.有ERP系统开发工作经验,会水晶报表,有良好的编程习惯


呵呵,待遇怎么样?
关注。。。

呵呵,頂一下,可以考慮一下。 --------------------编程问答-------------------- 还是没有人咨询呀,顶起来啊 --------------------编程问答--------------------
补充:.NET技术 ,  VB.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,