oracle分析函式_小貼(一)

wisdomone1發表於2010-12-17

SQL> select a from t_num;

                                      A
---------------------------------------
                                      1
                                      2
                                      3
                                     30
                                   -230

 

SQL> select a,first_value(a) over(order by a rows unbounded preceding) from t_num;

                                      A FIRST_VALUE(A)OVER(ORDERBYAROW
--------------------------------------- ------------------------------
                                   -230                           -230
                                      1                           -230
                                      2                           -230
                                      3                           -230
                                     30                           -230

 

--注:提取a列的最小值;last_value同理

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-682005/,如需轉載,請註明出處,否則將追究法律責任。

相關文章