I have a table called DOC_ADMISSAO2 where I have the date of birthday (datatype is date) and another date (datatype is date) and I want the age.
I used this query:
update DOC_ADMISSAO2
set IDADE = (SELECT EXTRACT(YEAR FROM DATACRIACAO) - EXTRACT(YEAR FROM DATAN)
from DOC_ADMISSAO2));
But it showed me this error:
Error starting at line : 2 in command - update DOC_ADMISSAO2 set IDADE = (SELECT EXTRACT(YEAR FROM DATACRIACAO) - EXTRACT(YEAR FROM DATAN) from DOC_ADMISSAO2) Error report - SQL Error: ORA-01427: subconsulta de linha Ășnica devolve mais que uma linha 01427. 00000 - "single-row subquery returns more than one row" *Cause:
*Action:
Help? I'm kinda new at this.
months_between() / 12. It is more accurate than a difference of years. - Gordon LinoffCASTit as an INT or applyFLOOR, anage 34.7536882653357754697looks strange :) - dnoeth