from (select a, max(revision) as revision from test where a between 2 and 200 group by a) x join test y using (a, revision);
While certainly simpler than my temp table this really just exposes a flaw in my example - I'm really going to be doing this with an arbitrary list of As.