有表一aa:(a,b,c)三列,
表二bb: (aa,b,cc)三列.想修改aa表中的a列,须根据bb表中的cc列,这样的修改这么做呢.谢谢.
表二bb: (aa,b,cc)三列.想修改aa表中的a列,须根据bb表中的cc列,这样的修改这么做呢.谢谢.
解决方案 »
- oracle中新建了一个用户,不能在sql developer中使用select语句
- 关于JDBC连接ORACLE的问题~~~~~~~~~~~~~
- win7 安装Oracle11g出错
- 求一个简单的关于日期期间的算法
- 数组排序报找不到数据的错误,还有如何将数组中的数值,重新赋值给原数据单元
- Oracle9i与Tomcat的冲突问题
- 如何学好Oracle的Forms和Reports进行开发
- 回滚段问题?
- oracle牛牛们救命啊!
- 在SQL PLUS下可以查到,但在DBA STUDIO表数据编辑器中却看不到!
- 在AIX环境下,我安装了一个ORACLE,但是当我执行命令sqlplus /nolog时并没有进入SQL〉而是进入$提示符,请问是什么原因?
- 字段分拆了,怎么来更新啊..
where exists (select 0 from bb where bb.b=aa.b)
set k.merchant_type = (select trim(merchant_type) from echinacard.test_merchant g where g.merchant_id = k.merchant_id and g.merchant_type = '103')
这句话多吗,为何加了条件修改,可把全部的数据都修改了啊
10001774 宁波中国国际旅行社家乐门市部 104
10001940 车奴汽车美容护理店 104
10001879 龙耀迪汽车租赁服务有限公司 104
10002060 港中旅国贸旅行社有限公司 104
10001880 龙耀迪汽车租赁服务有限公司 104
这是表air_merchant
merchant_id mer_big_type mer_name
10001774 104 其他
10001940 104 其他
10001879 104 其他
10002060 104 其他
这是表test_merchant
type_id type_name type_big
108 汽车 104
109 手机 104
110 其他 104
这是表air_merchant_type 表air_merchant中merchant_id与test_merchant中的merchant_id对应,test_merchant中merchant_big_type与air_merchant_type表中type_big对应.mer_name与type_name对应.我想经过这三张表修改air_merchant表中merchant_type 列.merchant_type列的值就是对应air_merchant_type表中type_id列.请问怎么做呢
from air_merchant_type b ,test_merchant c
where a.merchant_id=c.merchant_id and b.type_big=c.mer_big_type and b.type_name=c.mer_name)