0

I have a list of ID, a column NAMESPACE and other columns.

I would need to find IDs with same value for NAMESPACE but different values in other columns, so they are not duplicated rows.

In the example below, I would need to find rows with value Id_1 and NameSpaceA that are repeated three times in the example, but that are not duplicates in the table as other fields have different value.

ID.      NAMESPACE    OTHER
---------------------------
Id_1     NameSpaceA     X
Id_1     NameSpaceA     Y
Id_1     NameSpaceA     Z
Id_2     NameSpaceB.    W
Id_3     NameSpaceC.    A

Many thanks in advance

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Ana
  • 103
  • 1
  • 8
  • 1
    Can you add another example for the result you need to get when using the table in your example? – Yair I Nov 12 '21 at 20:58
  • Exact results of the final output you expect would be helpful... I sort of understand your problem but don't know what you want to see – Hambone Nov 12 '21 at 21:02
  • Thanks for your help! I have found the solution here (output would be the 3 items with Id_1 and NameSpaceA): https://stackoverflow.com/questions/46758645/find-duplicate-records-based-on-two-columns – Ana Nov 12 '21 at 21:14
  • Please accept it as duplicate. – Gert Arnold Nov 12 '21 at 21:20

1 Answers1

0

You can do a group by with id and namespace and print the count . If count is greater than 1, it is duplicated.

el07
  • 65
  • 1
  • 5
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 13 '21 at 00:07