13995643552
建站专栏
联系我们
13995643552
select 字段子查询 实现分数排名
您所在的位置:网站建设 » 建站专栏 » select 字段子查询 实现分数排名
select 字段子查询 实现分数排名
时间:2013/9/8 23:38:56;点击:2300
 
select 字段子查询 实现分数排名
sql="select 年级,班级,考试名称,考试学生,考试学号,语文成绩,数学成绩,英语成绩,政治成绩,历史成绩,地理成绩,物理成绩,化学成绩,生物成绩,综合成绩,总分"
sql=sql&",(select count(*)+1 from ks_cj a where a.语文成绩>aa.语文成绩)as 语文排名"
sql=sql&",(select count(*)+1 from ks_cj a where a.数学成绩>aa.数学成绩)as 数学排名"
sql=sql&",(select count(*)+1 from ks_cj a where a.英语成绩>aa.英语成绩)as 英语排名"
sql=sql&",(select count(*)+1 from ks_cj a where a.政治成绩>aa.政治成绩)as 政治排名"
sql=sql&",(select count(*)+1 from ks_cj a where a.历史成绩>aa.历史成绩)as 历史排名"
sql=sql&",(select count(*)+1 from ks_cj a where a.地理成绩>aa.地理成绩)as 地理排名"
sql=sql&",(select count(*)+1 from ks_cj a where a.物理成绩>aa.物理成绩)as 物理排名"
sql=sql&",(select count(*)+1 from ks_cj a where a.化学成绩>aa.化学成绩)as 化学排名"
sql=sql&",(select count(*)+1 from ks_cj a where a.生物成绩>aa.生物成绩)as 生物排名"
sql=sql&",(select count(*)+1 from ks_cj a where a.综合成绩>aa.综合成绩)as 综合排名"
sql=sql&" from ks_cj aa where 1=1 "&sq&" "&order
 
13995643552
[ 返回 ]
Copyright © 2013-2021 武汉网站建设
关闭