I need to delete all the Contributors that don’t have a License assigned to them
Table : Columns
Contributors : [id, Name,...]
Licenses : [id, ContributorId, Name, ...]
Something like this
DELETE FROM Contributors
WHERE
License.ContributorId != Contributor.Id
I believe this will work if you are using SQL Server:
A good test to do before actually doing the delete is to replace the
DELETE Contributorsline withSELECT *. This will show you all the records that are about to be deleted, so it’s a nice sanity check…So your sanity check would look like this: