ASHLEY AGE

Dúvidas, dicas e truques de SQL, Select, Update, Delete, cláusulas, operações com joins, Funções em SQLs, etc
  

Poston Thu, 06 Dec 2007 7:52 am

Hey guys, OK? --typical phrase of my friend Christian (Tineks), rs staff believe that vocês take I have to get the letter people age decrease for our year to get the age did so and not funfou FLOOR (TRUNC (u. NASCIMENTO_TITULAR)-TRUNC (SYSDATE)) age, he returns like this: nascimento_titular | old 2/12/1947 | -22212 what can I do to improve it:?:
carlos12
Location: rio

Poston Thu, 06 Dec 2007 8:12 am

Hey Carlos, beauty? hehehehehe (not to miss the usual) .... then, the calculation of age can be done in several ways, below is a way to make ... If anyone has any other suggestions will be very welcome! :)

Code: Select all
SELECT FLOOR (FLOOR (MONTHS_BETWEEN (SYSDATE, DT_NASCIMENTO)) / 12) idade
  FROM minha_tabela


[]'s!!
Tineks
Location: Araraquara - SP

Cristiano (Tineks)
Araraquara - SP

Poston Thu, 06 Dec 2007 8:42 am

PERSONALLY I ASKED And I EVEN SOLVED, RS Is DO THIS WAY: Age (U. NASCIMENTO_TITULAR, Sysdate) Age HERE HE BROUGHT JUST RIGHT.
carlos12
Location: rio

Poston Thu, 06 Dec 2007 8:44 am

Christian (Tineks) valeu once again dude, your worked also finished posting this up without having seen that you had posted but thanks cousin!







:D
carlos12
Location: rio

Poston Mon, 10 Dec 2007 9:31 am

Carlos, I was trying to move here, and I realized that first command Thu Thu you posted is correct, you put a só was Division after ... because the result gave was days Thu = D então if you divide by 365 or 366 will give the correct result = D
gokden
Location: Ribeirão Preto - SP

Lucas de Souza

OCA Developer
Analista de sistemas



Return to SQL

Who is online

Users browsing this forum: No registered users and 2 guests