Your question is pretty confusing but review the following sql statements to see if they help
// only get records which match on the id
Select
from table1, table2
where table1.id = table2.id
// get table2 records where they match in table 1, slower but sometimes necessary
Select
from table2
where table2.id in (select table1.id from table1)
You can also prefix the with the table name if you only want all the data from a specific table eg table1., table2.id
You can rename output fields eg select table2.id as tab2id, ...
I think you need to revisit your question and look at how you ask the question as I don't think your outcome is clearly defined.