Hello everyone, I am new to MySQL but just realized it does not support INTERSECT in MySQL 5.0 Community Server.
I have this problem to solve.
(1) cust_table
cust_id
city_code.
(2) agent_table
agent_code
cust_id
An agent may work for more than one customer.
My idea was to have two tables and use INTERSECT to produce a result that would list all agents that serve all customers in a particular city grouped by cities.
SELECT cust_id FROM cust_table where city_code IN (city1, city2)
INTERSECT
SELECT cust_id FROM agent_table;
But MySQL does not have INTERSECT so I am confused as to the solution.