zoukankan      html  css  js  c++  java
  • 在oracle中进行统计排序(跳跃排序和连续排序)

    -- 在oracle中进行统计排序(跳跃排序和连续排序)
    CREATE TABLE tb_score (
    id number(11) NOT NULL PRIMARY KEY,
    score number(11) DEFAULT NULL
    ) ;

    select * from tb_score;

    insert into tb_score select 1,87 from dual;
    insert into tb_score select 2,87 from dual;
    insert into tb_score select 3,97 from dual;
    insert into tb_score select 4,67 from dual;
    commit;

    -- 跳跃排序,有并列名次的情况下,整个排序序号不连续
    select id,score,
    rank() over(order by score desc) as "rank"
    from tb_score;

    --连续排序,有并列名次的情况下,整个排序序号是连续
    select id,score,
    dense_rank() over( order by score desc) "rank"
    from tb_score;

  • 相关阅读:
    UVa 481
    ZOJ 1108 & HDU 1160
    UVa 11450
    UVa 11242
    UVa 750
    UVa 725
    UVa 483
    UVa 10258
    UVa 793
    The Little Girl who Picks Mushrooms HDU 4422 水题类似模拟的一种感觉
  • 原文地址:https://www.cnblogs.com/babyha/p/12867505.html
Copyright © 2011-2022 走看看