求教update和select复合语句的写法
HitXU 2009-11-05 02:39:52 查询语句:
select * from statab where time>to_date('2009-10-03 10:00:00','YYYY-MM-DD HH24:MI:SS') and rownum<=100 order by time for update of flag skip locked
更新语句:
update satab set flag = 'new'
如何把这两个语句合成一个复合语句呢? 就是把查询到的记录的flag字段更新掉。
我尝试如下写法,但是不对:
update satab set flag = 'new' where rowid in( select rowid from statab where time>to_date('2009-10-03 10:00:00','YYYY-MM-DD HH24:MI:SS') and rownum<=100 order by time for update of flag skip locked )
请大家指点,这样的语句该怎么写呢? 谢谢了。