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