select *
from a join b #join is same as inner join
on a.a_id=b.a_id
i guess you have an id in both of your table , now lets say a_id
is primary key in your a
table and its a foreign key in your b
table. Then if you use a join
you will get the common records in both tables.