Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: An SQL question
Hello Chris,
try the following:
select max(Bal_Period)
from your_table
group by EmpIID,
Year;
Regards
Corinna
Chris Daugherty <quasar_at_flash.net> wrote in article
<35CF6ED9.4CA4_at_flash.net>...
> Greetings! I need write SQL to do the following:
> I have a table that has these columns:
>
> EmplID Year Bal_ID Bal_Period
> -----------------------------------------
> 8158 1997 CY 1
> 8158 1997 CY 2
> 8158 1997 CY 3
> 8158 1997 CY 4
> 8158 1998 CY 1
> 8158 1998 CY 2
> 8158 1998 CY 3
> 8158 1998 CY 4
> 8158 1998 CY 5
> 8111 1997 CY 1
> 8111 1997 CY 2
> 8133 1997 CY 1
> 8133 1997 CY 3
>
> I need to pull the maxium Bal_Period for each Year for each EmplID. How
> do I do that?
>
> Please respond as well as post the answer to cmdaugherty_at_pier1.com
>
> Thanks!
>
> CMD
>
Received on Tue Aug 11 1998 - 04:30:34 CDT
![]() |
![]() |