semoga bisa membantu anda :
 
SELECT nim,
    case when nim = lag(nim,1,nim) over (order by nim) then 
    lag(kd_gol,1,kd_gol) over (order by nim)
    else kd_gol
    end as kd_gol_lama, 
    kd_gol as kg_gol_baru, tgl_efective
from nama_table

Tari Ndut <[EMAIL PROTECTED]> wrote:
Dear All,
Maaf sebelumnya, karena dulu saya pernah nanya soal kaya' gini.. cuman
karena lupa ga-save script-nya + inbox didelete, maka saya ingin menanyakan
kembali bagaimana query untuk kasus seperti ini :

tabel A
nim          kd_gol            tgl_efective
0001         3A                  01/01/00
0001         3B                  01/01/01
0001         3C                  01/01/02
0001         3D                  01/01/03
0002         2A                  01/01/03
0002         2B                  01/01/04
0002         2C                  01/01/05

yang ingin saya tampilkan adalah....
nim       kd_gol_lama       kd_gol_baru     tgl_efective
0001      3A                       3A                 01/01/00
0001      3A                       3B                  01/01/01
0001      3B                       3C                  01/01/02
0001      3C                       3D                  01/01/03
0002      2A                       2A                  01/01/03
0002      2A                       2B                  01/01/04
0002      2B                       2C                  01/01/05

nb. Kasus tersebut merupakan kasus dalam menelusuri historikal
     perubahan golongan setiap karyawan.

terima kasih sebelumnya,

Tari.





--
-----------I.N.D.O - O.R.A.C.L.E---------------
Keluar: [EMAIL PROTECTED]
Website: http://indo-oracle.blogspot.com
-----------------------------------------------

Bergabung dengan Indonesia Thin Client User Groups, 
Terminal Server, Citrix, New Moon Caneveral, di:
http://indo-thin.vze.com 



---------------------------------
Yahoo! Groups Links

   To visit your group on the web, go to:
http://groups.yahoo.com/group/indo-oracle/
  
   To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
  
   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

[Non-text portions of this message have been removed]





--
-----------I.N.D.O - O.R.A.C.L.E---------------
Keluar: [EMAIL PROTECTED]
Website: http://indo-oracle.blogspot.com
-----------------------------------------------

Bergabung dengan Indonesia Thin Client User Groups, 
Terminal Server, Citrix, New Moon Caneveral, di:
http://indo-thin.vze.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/indo-oracle/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Kirim email ke