The following is the table I have
ID Name CodeID
ID 1 7
ID 1 5
ID 1 7
ID 2 5
ID 2 7
ID 3 5
I wanted to count distinct IDs when the code is 5 , code is 7 and code is 5&7.
Expected result: Count distinct values for the following category
Code is 5 3
Code is 7 2
Code is 5&7 2
Is it wise to use count distinct over partition by here. If not how to achieve this result?
Thanks in advance