EMPID || DateOFJoining || Designation || Section || EmpName 1 || 25 Oct 2007 ||Private Secretary, Gr II|| Establishment || Ajay 2 || 02 Aug 2006 || Section Officer || Establishment ||Raj 1 || 02 Aug 2006 || Private Secretary, Gr I|| Accounts ||Ajay 3 || 13 Oct 2010 || Reviewing Officer || Establishment || Kiran 1 || 01 Jan 2002 || Accountant || Accounts || Ajay
EMPID || DateOFJoining || Designation || Section || EmpName 2 || 02 Aug 2006 || Section Officer || Establishment ||Raj 3 || 13 Oct 2010 || Reviewing Officer || Establishment || Kiran 1 || 01 Jan 2002 || Accountant || Accounts || Ajay
SELECT a.* FROM employee A, (SELECT EMPID ,MIN(DateOFJoining) DateOFJoining FROM employee GROUP BY EMPID) B WHERE b.EMPID=a.EMPID AND b.DateOFJoining=a.DateOFJoining
select distinct EmpName, MIN(doj) from TblEmp group by EmpName
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)