I want to select the employees of the employee table who are managers, so I'm trying to use INTERSECT
but it's not working, I think the image says it all too, would you have another way to do it?
For the example you presented the code below will serve:
Select Gerentes.*, Funcionario.* from Funcionario JOIN Gerentes ON (Funcionario.Nome = Gerentes.Nome)
Just one caveat. In the image that showed there is no key between the two tables (Managers and Employees). I made the JOIN with the NAME field, because it was the only field I saw that could capture, but this is not ideal.
If possible create a foreign key in the table so that this JOIN is most effective and useful (in case there are two employees or managers with the same name this instruction will not work)
Creating a foreign key in MySQL