'Compare two columns in two different databases

I have a MySQL with two databases A, Z. Table A has fewer records than Z.tableZ. I am now interested in two columns: A.tableA.colA and Z.tableZ.colZ. I want to read the values from A.tableA.colA that are not in Z.tableZ.colA.

A.tableA.colA == Z.tableZ.colZ

Can I do this with a pure SQL query or do I have to write a script to read the data from one database and compare it with the other database.

I hope I have expressed it in a way that is easy to understand.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source