So, i have two tables, INTERNAMENTO and DOC_ADMISSAO2. i want to update a column from table INTERNAMENTO named DIASINTERNAMENTO with the same values of the table DOC_ADMISSAO2 called DIASADMISSAO, with some conditions..
update INTERNAMENTO a
set a.DIASINTERNAMENTO = (
select b.DIASADMISSAO
from DOC_ADMISSAO2 b
where (a.EPISODIO = b.EPISODIO) AND (a.DATACRIACAO <= b.DATACRIACAO));
It gives me an error:
- 00000 - "single-row subquery returns more than one row"
Any advice?
Aucun commentaire:
Enregistrer un commentaire