这样的SQL通不过,该怎么写?

suchunyuan1981 2008-11-19 04:12:35
使用ODBC访问EXCEL,现在EXCEL中有表student
学号 成绩
001 60
002 80
003 80
004 90
005 100
现在想得出学号和排名结果:
001 60 5
002 80 3
003 80 3
004 90 2
005 100 1
"select 学号,(select count(*) "+
"from table student where 成绩<student.成绩) from table student";
这样写,结果程序说我语法错误
是不是因为SQL不标准?应该怎样写?
...全文
38 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
cschina 2008-11-19
  • 打赏
  • 举报
回复
"select 学号,(select count(*) "+
"from table student b where b.成绩 <a.成绩) from table student a";
不行的话,再试试
"select 学号,(select count(*) "+
"from student b where b.成绩 <a.成绩) from student a";

4,011

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 数据库
社区管理员
  • 数据库
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧