My question is almost identical to SQL DELETE with INNER JOIN ; but I want to delete on non equal!
MY PROBLEM IN A BRIEF: There are 2 tables, bus_stops, bus_routes ;
bus_routes {id, bus_route_id,..other columns..}
bus_stops {id, bus_route_id,..other columns..}
Some routes had been deleted, but bus stops remaining, I need to delete them too. Means, I need to delete only bus_stops, which have NO associated bus route!
It means something like:
DELETE bs.* FROM bus_stops AS bs
INNER JOIN bus_routes AS br
ON bs.bus_route_id <> br.bus_route_id
But the above code will definitely not work.