Yes, it's called a temporary table. You basically run your fist query and it builds a table in memory of the results and then you run your second query on that table.
Look up the syntax for temporary tables in your database documentation. It's usually something like:
create temporary table temp_tab (
select a.field1, b.field2
from table1 a, table2 b
where a.id = b.id)
or something like that. Then you can query temp_tab as if it was a table in your database. But remember that temporary table will be removed when your connection to the database is ended.