I\'m trying to get all participants that have more than 1 record in the table where at lease one of those records has IsCurrent = 0 and IsActive = 1
This is what I have
select ParticipantId from Contact as c group by ParticipantId having Count(*) > 1 and Sum(Case when IsCurrent = 0 then 1 else 0 end) >= 1 and Sum(Case when IsActive = 1 then 1 else 0 end) >= 1
I would first try this