Ah, but don't these two answers simplify to solutions 1 and 2 in my original post? The DBMS solution corresponds to solution 2 (though I suppose it would be a bit faster), and the running count solution is the same as solution 1, I think. Am I missing something?
--