Click here to Skip to main content
12,756,892 members (36,840 online)
Rate this:
Please Sign up or sign in to vote.
See more: SQL-Server
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.

Posted 9-Feb-13 0:24am
What did you try so far?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

SELECT empid, MAX(startdate) AS MaxStartDate
FROM employementhistory
GROUP BY empid 
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)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 14 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100