I need to run the following update script
update table1 set col1 = 'xxxx',
col2 = (select cc.client_type
from table2 t2, table3 t3, table1 t1
where t2.col3='YYY'
AND t3.col4 != 'aaa'
AND t3.col5 = 'Y'
)
I am getting following error
Error report:
SQL Error: ORA-01427: single-row subquery returns more than one row
01427. 00000 - "single-row subquery returns more than one row"
I am using Oracle 10g. Any help on this??
will update necessary record (provided inner query returns only one row). However, it will be a constant value (where random_col is some column which can be associated with both table2 and table3, random_col2 is some column which can be associated with both table3 and table1)
Another possibility can be :-
The above will update table1 with different(or same) values depending on table2 and table3