I barely know how to ask this question aside from the specific example, so here goes:
We have an event registration table, and I want to match registrants that have registered for one of 4 events in each of the preceding 5 years.
The only way I can think of doing this is with verbose sub-queries, but performance-wise it's an absolute dog:
SELECT FirstName, LastName, EmailAddress
FROM RegTable
WHERE EventId IN (1,2,3,4)
AND EventYear = 2011
AND FirstName + LastName + DOB IN (SELECT FirstName + LastName + DOB FROM RegTable WHERE EventId IN (1,2,3,4) AND EventYear = 2012)
And so on for each year. Like I said, not very eloquent or efficient.
Is there a simpler way?