Friends,
I have few records like thiis
**empNum SlNo CODE
4001 1 SRM
4002 2 SRD
4003 3 SRA
4004 4 SRQ
4000 5 SRQ
4001 6 SRQ
4002 7 SRM
4003 8 SRM
4004 9 SRM
4000 10 SRP
4001 11 SRX
4002 12 SRD
4003 13 SRQ
4004 14 SRA
I want to make some queries whose result will satisfy these criteria.
Query 1.
i want to get distinct employee codes
whose "CODE" value = search criteria value i Will give
and
whose SL.NO is the max of the SL.no value for that particulat SL. no
i.e fetch the record whose SL.No is maximum when grouped by the empnum and whose code is what we specifed
Query 2
Another ouput should be
get the empcode, the maximum value of Sl. no for it and the code corresponding to that SL.no