as far as I have read subqueries are not allowed in phpBB because some DBMS do not support them - right?
How can I accomplish this without subquery:
I have 2 tables:
A with columns: 'id' and 'name'
B with columns: 'id' and 'a_id'
I want to delete all from A where A.id does not exist in (SELECT a_id FROM B)
with subquery, I could do it:
Code: Select all
$sql = 'DELETE FROM A WHERE NOT EXISTS ( SELECT 1 FROM B WHERE B.a_id = A.id )'; $db->sql_query($sql);
Thanks for help!!