I have a table that stores membership records. One record per member, per year.
eg:
MEMBER YEAR
--------------
steve 2011
steve 2010
bob 2010
jane 2011
What I’m trying to generate is a list of lapsed members (those who haven’t renewed) for a given year. Something like “get all members who have an entry for 2010 but not 2011”.
I’ve been wrestling with this one for a while and the closest examples I can find involve comparing two tables.
Using LEFT JOIN/IS NULL
Using NOT EXISTS
Using NOT IN
Performance
Performance depends on if the columns compared are NULLable (the values can be NULL):