select Distinct row from the table

  • I have a table with column EMPNO and EMPDATE and I have the following data

    EmpnoEmpDate

    112/12/2001

    114/12/2001

    217/05/2001

    318/05/2002

    I want the following output with the recent empdate and the empno should be distinct .Can any one send me a query for this:

    EmpnoEmpDate

    114/12/2001

    217/05/2001

    318/05/2002

    Thanks in advance

  • select empno,max(empdate)as empdate

    from tblX

    group by empno

  • Thank you Klaas-Jan ..It worked...

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply