Say I have an entity A in one table and an arbitrary number of other entities B related to it in other table.
I have a situation where I need to replace all those B entities with a list of new B entities in a way that there should be no duplicates.
Simple way would be to issue a DELETE query first to remove all the old ones and then an INSERT query for new ones but I wonder if there's a way to do it in one query?