[SQL ] update的問題
資料庫是oracle
Update ( Select A.a
From table A
Where A.b in (Select B.b
From table A,table B
Where A.b=B.b
and A.c is null
And B.c='Y'))
Set A.a ='Y' ;
我寫了一個procedure如上,上面update的筆數是15筆
想請問有沒有辦法可以只update後面10筆
select * from (select * from A order by B desc ) where rownum <=1
之前找到上面這個寫法,但是因為資料庫版本太舊所以沒辦法使用
想請問一下不知道還有沒有其他方法也可以取得後面10筆的資料,謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.25.209.105
→
11/07 22:39, , 1F
11/07 22:39, 1F
→
11/07 22:45, , 2F
11/07 22:45, 2F
討論串 (同標題文章)
完整討論串 (本文為第 6 之 6 篇):