首页 > 代码库 > oracle 分区小实例

oracle 分区小实例

--年级排名表
drop table graderecord
create table graderecord (
sno varchar2(10),
sname varchar2(20),
dormitory varchar2(5),
grade int
)
partition by range(grade)(
partition bujige values less than(60),
partition jige values less than(85),
partition youxiu values less than(maxvalue)

);
select *from graderecord;
insert into graderecord values(‘1001‘,‘刘‘,‘202‘,92);
insert into graderecord values(‘1002‘,‘里‘,‘2034‘,52);
insert into graderecord values(‘1003‘,‘张‘,‘20244‘,41);
insert into graderecord values(‘1004‘,‘牛‘,‘2025‘,62);
insert into graderecord values(‘1005‘,‘l的‘,‘2026‘,69);
insert into graderecord values(‘1006‘,‘为期‘,‘2027‘,73);
insert into graderecord values(‘1007‘,‘个人‘,‘2028‘,84);
insert into graderecord values(‘1008‘,‘给他‘,‘2029‘,85);
insert into graderecord values(‘1009‘,‘热风‘,‘2072‘,42);
select *from graderecord partition(bujige);
select *from graderecord partition(jige);
select *from graderecord partition(youxiu);



oracle 分区小实例