一、实现思想:
对于单张成绩表(score)需要实现其排名,需要对自身的表进行数字比较;
二、表table(score)
建表:
create table score(
studentid int primary key,
username varchar(20) not null,
scores int not null,
scoretype varchar(20) not null );
批量插入数据:
insert into score values(
(1,'yangkan',90,'语文'),
(2,'kangxuxu',100,'语文'),
(3,'wangzhen',120,'语文'));
实现排名: