解决方案 »
- 在ubuntu安装oracle报错:Can't connect to X11 window server using ':0.0' as the value o
- Oracle怎么进行优化?
- 求助,关于触发器。
- PLSQL Developer的安装问题
- Win2003+Oracle10g 安装过程中OracleCSService无法启动
- 谁有PL/SQL的文档资料?
- 分段查询的sql语句怎样写?
- 超难问题,分不够再加
- Oracle中有无位或操作的函数或是运算符
- win10安装oracle数据库出现问题,百度的方案都不行啊,求救!!
- 请教一下Oracle AWM 立方体数据更新的问题
- 求一sql语句
--不就修改一个值,干嘛要取出来改完再写回去?直接update不就好了
update carInfo set flag = 0 where flag = 1; --这样肯定不会取出已经改过的记录的
insert into carInfo
select car_id,lat,lng,decode(flag,1,0) from carInfo where flag=1;
他的意思是update后再插回去,你这个就是update,明显不符合的!
select car_id,lat,lng,decode(flag,1,0) from carInfo where flag=1;
update carInfo set flag=0 where flag=1;
commit tran
-- 你的置1为0的操作,应该是更新操作,为什么像是插入操作(插入时,只是将 flag变为0了) 呢?
取出来的时候怎么可能知道什么时候处理完呢?
update carInfo set flag = 2 where flag = 1 ;
-- 提交防死锁
commit;
-- 取出所有flag = 2的数据
select * from carinfo where flag = 2;
/*处理数据*/
-- 更新所有flag = 2的数据flag = 0
update carInfo set flag = 0 where flag = 2 ;
--提交
commit;