To run queries that intersect in Oracle, PostgreSQL, and SQL Server, you can use the INTERSECT operator. The following screenshot shows you the output resulting from INTERSECT:
The previous query from MySQL would be rewritten like this for the other RDMS:
USE lahmansbaseballdb
SELECT playerid
FROM batting
INTERSECT
SELECT playerid
FROM appearances
ORDER BY playerid;
The previous query will return rows where the two tables have overlap.