I have a table with the columns Lkup_Value and Report_Date. Based on the below table I need to write the SQL Script like, if for the same Report_Date there are two Lkup_values values, then need to take only one Lkup_Value.
Lkup_Value | Report_Date
-------------------+------------------------------
MMM |2022-07-11
MMM-IR |2022-07-11
MMM-IR |2022-07-04
MMM |2022-07-04
CCC |2022-01-26
CCC |2022-01-03
OutPut:-
Lkup_Value | Report_Date
-------------------+------------------------------
MMM |2022-07-11
MMM |2022-07-11
MMM |2022-07-04
MMM |2022-07-04
CCC |2022-01-26
CCC |2022-01-03
For example, for the Report_Date “2022-07-11” there are two Lkup_Values i.e. “MMM” and “MMM-IR” then, in this scenario I need to take only "MMM". Overall If a day (Report_Date) contains the Lkup_Values “MMM” then irrespective of another values I need to take only "MMM".