delphi7中让edit里显示select count(student-sno) as 大于九十分的人数 from s

问题描述:

delphi7中让edit里显示select count(student_sno) as 大于九十分的人数 from score where total_score>90
的百分比,就是大于九十分的人数占总人数的百分比,
1个回答 分类:数学 2014-11-19

问题解答:

我来补答
简单点可以这样写:
select count(student_sno) as 大于九十分的人数 from score where total_score>90
select count(student_sno) as 人数 from score
相除就可以了
再问: 代码怎么写???adoquery1.SQL.Add('(select cast(((select count(*) from score where course_cno='''+form1.Edit1.Text+''' and total_score >= 90) / (select count(*) from score where course_cno='''+form1.edit1.text+'''))*100 as varchar(10)) as 百分比 from score)');我这样写,运行的时候总是等于0,怎么回事??
 
 
展开全文阅读
剩余:2000