Yes, use that first query as though it were a table, at least as far as the second query goes. Try it before asking, it's a wonderful thing to see it work.