update table set fmonth = Add_months(fmonth, '1')
where rowid in
(
select t1.rowid from
(select * from table where to_char(a,'mm') = to_char(sysdate,'mm')- 1) t1,
(select * from table where to_char(a,'mm') = to_char(sysdate,'mm') ) t2
where t1.f1 != t2.f1 and t1.f2 != t2.f2 and t1.f3 != t2.f3
)
where rowid in
(
select t1.rowid from
(select * from table where to_char(a,'mm') = to_char(sysdate,'mm')- 1) t1,
(select * from table where to_char(a,'mm') = to_char(sysdate,'mm') ) t2
where t1.f1 != t2.f1 and t1.f2 != t2.f2 and t1.f3 != t2.f3
)
解决方案 »
- 关于oracle问题,急啊。 谁能帮我解决问题分全给你。
- oracle express edition 有图形界面吗
- 两台服务器间实时同步问题
- oracle 10g不支持64位的
- ORA-01461: can bind a LONG value only for insert into a LONG column
- 大家来支持一下我们ORACLE社区的建设,谢谢
- !!!!!!PL/SQL Developer跟踪Oracle9i SQL 的简单问题!!!!!!
- 求一个SQL语句,请高手近来帮忙看看!
- 关于日期查询的问题,牛人请进,在线等,答对马上给分!!!
- 一个数据库链的问题
- ASP.net程序运行出错,无法加载oci.dll!!曾经可以,重做系统又不行了,请教各位碰到过此问题的高手!
- 给电信作一个系统,每天要生成几万条记录,该怎么存储?
update T1 a set fmonth = fmonth + 1
where exists (
select * from(
select f1,f2,f3,fmonth,count(*) over(partition by f1,f2,f3) num
from T1
where extract(month from sysdate) - fmonth <= 1) b
where b.num = 1 and b.f1= a.f1 and b.f2= a.f2 and b.f3= a.f3)
and a.fmonth = extract(month from sysdate) - 1