I have a table in SQL Operations Studio (SQL Server) with columns A, B, C, D. I want to query all rows with the following conditions:
EDITED WITH SAMPLE DATA
A B C D
1 a b c r
2 g b c r
3 n h f r
4 k u e z
5 h i e z
- Values in Column C & D match at least 2 times
- Value in Column D must appear at least 3 times
Return:
A B C D
1 a b c r
2 g b c r
3 n h f r