Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Oracle 仅当表2中的列3匹配时才更新表1中的列1_Oracle - Fatal编程技术网

Oracle 仅当表2中的列3匹配时才更新表1中的列1

Oracle 仅当表2中的列3匹配时才更新表1中的列1,oracle,Oracle,仅当表1中的列2与表2中的列3匹配时,我才想更新表1中的列1 我试图使用这个查询,但我得到一个错误,说我缺少等号。 有人能帮忙吗 update schema1.table1 set schema1.table1.column1 where schema1.table1.column2 = table2.column1 你的错误说明了一切。您没有为列指定任何值。尝试使用等号=设置该值 你可以试试这个:- update shema1.table1 set shema1.table1.culomu

仅当表1中的列2与表2中的列3匹配时,我才想更新表1中的列1 我试图使用这个查询,但我得到一个错误,说我缺少等号。 有人能帮忙吗

update schema1.table1 set schema1.table1.column1
where schema1.table1.column2 = table2.column1

你的错误说明了一切。您没有为列指定任何值。尝试使用等号=设置该值

你可以试试这个:-

update shema1.table1 
set shema1.table1.culomun1 = //The value which you want to store
where shema1.table1.culomun2 = table2.culomun1

与错误消息中一样,您在查询中丢失了一个=并且没有为shema1.table1.culomun1分配任何值

试着这样,

UPDATE shema1.table1 
SET    shema1.table1.culomun1 =<your_value>
WHERE  shema1.table1.culomun2 = table2.culomun1;
请尝试以下查询:

update shema1.table1 t1 set t1.culomun1 = (select t2.culomunX from table2 t2
where t1.culomun2 = t2.culomun1)
where t1.culomun2 in (select culomun1 from table2)