I'm trying to do an oracle update with completely different information and I do not know how to do it. I want all other campuses to be the same as campus 1, where this id_campu is a foreign key with another table. Example:
col1.id | col2.descricao |col3.id_campus| col4.flag
1 desc1 1 a
2 desc2 1 b
3 desc3 1 c
4 desc2 1 d
5 desc3 1 e
6 1desc 2 a
7 1desc 2 b
8 1desc 2 c
9 desc2 2 b
10 desc1 2 c
11 1desc 3 b
12 d1esc 3 d
13 d1esc 3 c
14 desc2 3 e
15 des1c 5 a
UPDATE table1 t1
SET (descricao, flag) =
(SELECT t2.descricao, t2.flag
FROM table1 t2
WHERE t1.id_campus = 1
)
WHERE t1.id_campus in (select t3.id_campus from table1 t3 where t3.id_campus not in (1));
But there, it gives the error: ORA-01427: the subquery of a single linharetorna more than one line.