I have two tables t1 and t2. Their columns only share itemid (Unique) together (They both have that column to identify items). t1 deletes rows with certain values (column called nbr). I want t2 to delete all rows with same itemid.
I've done a few attemps but no success. Here's an example of what I've tried in PHP.
$result = "DELETE FROM t1,t2 WHERE t1.value<5 AND t1.itemid=t2.itemid";
mysqli_query($db, $result) or die('Error');
I've also looked in to 'left join' but no success. So I'm starting to think that there is no simple query to do this but I want to check with this community first before trying a longer (slower) solution.
EDIT: What I want to do resembles comparing two tables with each other and removing those itemid that don't exist on both tables.