try:
update a set a.aa=(select b.bb from b.bb where a.c=b.x)
update a set a.aa=(select b.bb from b.bb where a.c=b.x)
解决方案 »
- 做应用系统的用户与表空间设计
- 如何删除oracle数据后台的TYPE
- PLS-00703: 列表中具有指定参数的多个实例
- 关于一个sql的弱智问题
- 高分求查询语句,组查询语句,更加客户编号,记账日期,单号,余额查询是否有相同的数据。
- 各位大大,想做开发,求教需要哪些知识
- 有张表里有800W条数据,在用like模糊查询时非常慢,如果做集群请问会快吗?
- Oracle数据库sql脚本运行结束,如何退出?
- !一个让人头疼的统计……
- 怎样写这个sql,急,谢谢
- 在连接数据库是出现以下提示:没有发现 Oracle 客户端和网络组件。这些组件由 Oracle 公司提供,是 Oracle 7.3.3版(或更新)客户端软件安装
- oracle中间怎么写full join
update a set a.aa=(select b.bb from b where a.c=b.x and rownum=1)
set aa = (
select bb
from b t2
where t1.c = t2.x
)
update tset ( x,y,z)
= ( select x,y,z
from t1
where t.x ==t1.x)
where exists
( select x,y,z
from t1
where t.x ==t1.x)
Why is it necessary to give the whole query, woudnt it suffice to just say
update tset ( x,y,z)
= ( select x,y,z
from t1
where t.x ==t1.x)
where t.x =: some value we know
Followup: that doesn't make sense. where did you get "some value you know"the first query with the where exists -- that will update every row in T with a
value in T2 given that a row exists in T2 to update t withyour query will update every row in T where t.x = some_value -- if no values
exist in T2, t.x,y,z will be set to NULL
they are totally different
多行要加个条件