I have two tables. One (Widgets) has a list of widgets (ID, widget_name, color, etc...) and data about them. The other one (Tests) has a list of tests run on the widgets (ID, d
If you need the two most recent tests overall, then
Select * From Tests T
Where (Select Count(*) From tests
Where testDate > T.TestDate) < 2
If you need the two most recent tests for each Widget, then
Select * From Tests T
Where (Select Count(*) From tests
Where WidgetId = T.WidgetId
And testDate > T.TestDate) < 2