Click here to Skip to main content
15,897,090 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello all,

I have employeement history table in this table empid, jobtitle, startdate, enddate columns are there.
each employee can enter more than one time his jobtile each time he select startdate and enddate
but my requirement is i want to get max startdate jobtile in each employee. suppose i have 20 employees so
i want to get 20 jobtitles. Please tell me any one.

Thanks
Posted
Comments
Sergey Alexandrovich Kryukov 9-Feb-13 13:35pm    
What did you try so far?
—SA
[no name] 14-Feb-13 21:42pm    
Atleast try once and then post your problem here.

1 solution

SQL
SELECT empid, MAX(startdate) AS MaxStartDate
FROM employementhistory
GROUP BY empid 
 
Share this answer
 
Comments
Maciej Los 14-Feb-13 15:49pm    
Good work, +5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900