在SQL语句中,我有一个超长的位置
update ABC_table
set XXX_column = 10
where YYY_column in ('00-0093149',
... upto 700 values)在Oracle中有更好的方法吗?也许类似于Extra Long Where/In Statement - Better option?
不用excel?
谢谢
发布于 2014-03-01 08:51:44
嗯,您说值来自DB,这是同一表的一个列。
然后,可以将查询更改为
update ABC_table
set XXX_column = 10
where YYY_column in ('00-0093149',
... upto 700 values)至
update ABC_table abcout
set XXX_column = 10
where exists (select null
from ABC_table abcin -- the same table
where abcout.YYY_column = abcin.COLUMN_FOR_THE_SAME_TABLE
/* and maybe some more restrictions here */);其中COLUMN_FOR_THE_SAME_TABLE是具有值的列。
https://stackoverflow.com/questions/22106811
复制相似问题