Re: sql help

Re: sql help

 

  

Try this:
SELECT empid, max(promotion_date) last_pro_date, job
FROM my_table
GROUP BY empid, job

Pat Reither


Jeff Chirco wrote:
> Here is my dilemma. I have the table like below
>
>
>
> EMPID DATE JOB
>
> 355 8/9/2003 450
>
> 355 9/18/2004 440
>
> 355 2/7/2005 450
>
> 355 8/18/2006 440
>
> 355 11/25/2006 440
>
>
>
> What I need to get is somebody's last promotion date. So if I want to
> see when this person was last promoted to job 440 I want to see
> 8/18/2006, not 11/25/2006 or 9/19/2004. Or if I want to see when this
> person was last promoted to job 450 I would expect to see 2/7/2005. I
> can't figure out how to query this data.
>
> Thanks for any help.
>
>
>
>
>
> Jeff
>
>
>
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To post a dba job: http://jobs.lazydba.com
> To Subscribe : http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>
>
>


Oracle LazyDBA home page