Subject | Delete 'where not referenced' ??? |
---|---|
Author | benedicte_asselin |
Post date | 2004-12-10T10:57:16Z |
Hello,
I want to delete rows in a table where the primary key is not
referenced. something like:
DELETE FROM mytable WHERE primary_key NOT IN (SELECT theref FROM
referertable)
Is such a request internaly optimized ? (I suppose there is some
flag already in a row to note if it is referenced)
can I simply do a DELETE FROM mytable without any other test and
only those rows that are not referenced would be deleted ?
is there a better way to do that ?
please help
Benedicte
I want to delete rows in a table where the primary key is not
referenced. something like:
DELETE FROM mytable WHERE primary_key NOT IN (SELECT theref FROM
referertable)
Is such a request internaly optimized ? (I suppose there is some
flag already in a row to note if it is referenced)
can I simply do a DELETE FROM mytable without any other test and
only those rows that are not referenced would be deleted ?
is there a better way to do that ?
please help
Benedicte