Here is your query, formatted with a proper join
clause:
SELECT a.request, a.city
FROM pages a join
TNDB_CSV2 b
on a.main_id = b.PerformerID and a.city = b.City
WHERE b.PCatID = '3' AND
b.TicketsYN = 'Y' AND
b.CountryID IN ('38', '217') and
a.catnum = '303'
GROUP BY b.PerformerID, b.City
HAVING COUNT(*) > 4
ORDER BY a.name ASC;
You should be able to improve the performance of this query with indexes. Here are two that I can think of:
pages(catnum, main_id, city, name)
TNDB_CSV2(PerformerID, city, PCatID, TicketsYN, CountryID);