dimanche 21 décembre 2014

Deleting duplicate rows with condition(Using SQL and LINQ)


I have a table with 5 columnsID,CPT4,CPT4Mod,ItemCharge,Eff_Date.


Deletion Condition:


When rows exists with duplicate CPT4and CPT4Mod field values but different ItemCharge and Eff_Date values, exclude all but the most recent Eff_Date records.


I need a query which can achieve this in two scenarios.



  1. When CPT4Mod is given by the user.

  2. When CPT4Mod is not given by the user.


Later I need to achieve the same using LINQ.





Aucun commentaire:

Enregistrer un commentaire