Problem description:
I have a table which primary key is id and I also have an array of ids. The array contains ids from the table but some ids of the table may be missing in the array. I need to delete the rows of which ids are missing in the array.
My approach:
I fetch all the ids from the table and sort the two array. Then comparing two array I find out the missing ids and deleted corresponding rows.
Is there any better( easy and/or efficient) way to do this?