学生成绩表
的有关信息介绍如下:1、创建测试表,
create table test_score(name varchar2(20), score number);
2、插入测试数据
insert into test_score values('张三', 85);
insert into test_score values('李四', 90);
insert into test_score values('王二', 95);
insert into test_score values('吴七', 83);
insert into test_score values('李六', 66);
commit;
3、查询表中全量数据,select t.*, rowid from test_score t;
4、编写sql,根据学生姓名,查询学生名词,以学生‘李四’为例,成绩排名第二; select t.* from (select t.*, rank() over(order by score desc) rk from test_score t) t where t.name = '李四';