读书人

ORA-00904

发布时间: 2014-01-28 21:21:26 作者: rapoo

table ta,tb

update ta t set t.sal='100' where t.name=tb.name
and tb.page='1000'
为什么执行的时候出错误
ORA-00904: "TB","PAGE": invalid identified

------解决方法--------------------------------------------------------

SQL code
update ta tset sal = '100'where exists(select 1 from tb where name= t.name and page='1000')
------解决方法--------------------------------------------------------
探讨
SQL codeupdate ta t
set sal = '100'
where exists(select 1 from tb where name= t.name and page='1000')

------解决方法--------------------------------------------------------
1楼的sql正确 是只更新ta阿
------解决方法--------------------------------------------------------
探讨
SQL codeupdateta tsetsal='100'where exists(select1fromtbwherename=t.nameandpage='1000')

------解决方法--------------------------------------------------------
楼上的就正确,你要是不放心就用我这个,绝对唯一!
update ta t
set t.sal = '100'
where t.rowid in (select ta.rowid
from ta, tb
where ta.name = tb.name
and tb.page = '1000');
        

读书人网 >oracle

热点推荐