Number of midterms where the Democrats did well despite holding the White House: 3 (1934, 1962, and 1998)
Number of midterms where the GOP did well despite holding the White House: 1 (2002)
Interesting that people still think midterms favor the GOP...
Two of the elections were before the realigning congressional elections of 1994. Before 1994 the Democrats controlled the house for all of the past 40 years, and the Senate all but 6 of the years just like before 1992 the Republicans were the dominant party for the presidency winning the 7 out of the past 10. 1992 and 1994 reversed the trends of the 40 years before those elections.