I want a query to select more than 4 AccountId repetitions from table2 having distinct name in table1
Here are the table structures:
table1 | Table2
ID AccountNumber Name | ID AccountNumber AccountID
1 12345 John Jeff | 1 12345 A467T
1 12345 Patrick Jones | 1 12345 A467T
ID and AccountNumber are the same on both tables
- Table1 has Name
- Table2 has AccountID
Here’s a query to find AccountID’s with more than 4 different names:
If that’s not what you were looking for, please clarify the question! For examole, you could add desired output.
EDIT: In reply to your comment, you could query the ID and Numbers with a subquery: