:

SQL:

SELECT * FROM A INTERSECT SELECT * FROM B;