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