Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Query question
Bob McConnell wrote:
>
> Need help with:
>
> I have a table with columns ID and TASKNO which
> looks like:
>
> TASKNO ID
> 1 JOB1
> 2 JOB1
> 3 JOB1
> 1 JOB2
> 2 JOB2
> 1 JOB3
> 2 JOB3
>
> I need to be able to select one of each ID
> based on the highest TASKNO
>
> Resulting in
> TASKNO ID
> 3 JOB1
> 2 JOB2
> 2 JOB3
>
> Thanks,
> Bob
do you mean
select max(taskno), id
from table
group by id
?
Christian Received on Tue Jun 02 1998 - 07:45:17 CDT
![]() |
![]() |