select 语句只能返回一条记录,这条记录包含两列。取得班级里成绩最差的学生记录。但是可能会有两个学生的成绩并列最差,这时就返回学号(id)靠前的学生记录
希望大家能够帮我将以下的 select 语句补充完整。谢谢!
SELECT a.Id, a.count
FROM t_ro_stud a
WHERE a.class= '1' order by a.count ;
希望大家能够帮我将以下的 select 语句补充完整。谢谢!
SELECT a.Id, a.count
FROM t_ro_stud a
WHERE a.class= '1' order by a.count ;
解决方案 »
- oracle9i的驱动程序是classes12.jar吗?还是什么?
- 数据恢复问题,急救!!
- 我在oracle中发现dbms._output.put_line 不能输出大于255的字符串?
- SQL语句或C#去实现 求方法 急~~~~~~~~
- 关于数据库连接
- XXX IS NOT NULL 和 not XXX is null 有什么区别吗?
- oracle 9i 点击enterprise manager console 操作系统没有反应
- 用c/s模式访问oracle 数据库,如何刷新
- java的sql.ResultSet无法转换成Oracle的.OracleResultSet,急救!!!
- 代问:中文版的Oracle Universal Installer(就是Oracle安装程序),好像没有地方选择改变字符集?
- 发个“蛋”帖,嘿嘿~
- oracle插不见数据
FROM t_ro_stud a
WHERE a.class= '1' order by a.count,a.Id ) b
where rownum = 1;
FROM t_ro_stud a
WHERE a.class= '1' and rownum =1 order by a.count ;
commit;
insert into t_ro_stud values(1,324);
insert into t_ro_stud values(2,324);
insert into t_ro_stud values(3,354);
select * from t_ro_stud;
commit;
select Id,count
from (select a.Id, a.count, row_number() over (order by a.count asc,a.id desc) rank from t_ro_stud a)
where rank = 1;
FROM t_ro_stud a
WHERE a.class='1' and rownum=1 order by a.count, a.Id;
FROM t_ro_stud a
WHERE a.class= '1' and r=1;