Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL question, calculating average age by group
Gents... thanks for the help so far! I did know going into it that the
n / 365.25 was incorrect but it was something I tried to crank out
really quickly and hence the mathmatical approximation.
When I started seeing some of the optput later on though, that little voice inside my head said something was wrong... so I decided to ask this group for insight.
Also, I tried using this SQL statement:
select s_etype, avg (floor((months_between(sysdate,d_birthdate)/12)) from pass.t_personnel group by s_etype
And I keep getting missing right parenthesis errors (the asterik appears underneath the "from"). I'm wondering if its because of the months_between function? I'm not familiar with months_between... is it a provided function like 'floor''?
Thanks! Received on Wed Aug 24 2005 - 15:54:04 CDT
![]() |
![]() |