I had posted a similar question before, But this one is little modified.
I have a table with 4 rows as shown below.
ITEMCHARGE CPT4 EFF_DATE CPT4MOD
326.8 29075 20101204 GO
326.8 29075 20110104 GO
326.8 29075 20110204 GO
326.8 29075 20110406 GO
352.69 29075 20090611 GO
352.69 29075 20090917 GO
352.69 29075 20100614 GO
352.69 29075 20100722 GO
Now, If CPT4 and CPT4MOD is matching then I need to keep the rows with distinct ITEMCHARGE(with latest EFF_DATE). So the output should be like below.
Because, there are 2 distinct ITEMCHARGE for the same CPT4 and CPT4MOD. So we took the latest EFF_DATE row for both of them.
It will be very helpful If I can get a linq(with lamda) and sql version for this.
ITEMCHARGE CPT4 EFF_DATE CPT4MOD
326.8 29075 20110406 GO
352.69 29075 20100722 GO
Aucun commentaire:
Enregistrer un commentaire