2.就是if then,很简单的1和3,都是9i以后出的排序函数,在Expert one-on-one Oracle这本书中有说。itpub上也有人说。
网上可以查,有很多。

解决方案 »

  1.   

    case when Grade<=100 and Grade>84 then 1 else 0 end的意思是如果:Grade<=100 and Grade>84 则加1,其他的加0,也就是统计100-84这个数据段的数量。
      

  2.   

    1和3都是同一个语法:oracle的分析函数。
    2是case....when ....then ...else ...end 语法
      

  3.   

    row_number() over (partition by col1 order by col2)表示根据col1分组,在分组内部根据 col2排序
    而这个值就表示每组内部排序后的顺序编号(组内连续的唯一的)
    rank()是跳跃排序,有两个第二名时接下来就是第四名(同样是在各个分组内)sum(case when Grade<=84 and Grade>69 then 1 else 0 end) "84-70",
    当符合条件Grade<=84 and Grade>69时 CASE的值为1, 否则CASE=0
    SUM 用来统计满足条件 Grade<=84 and Grade>69 记录条数