I have the following query:
delete from Copies
where (id,MovieID) IN (
select distinct id,MovieID
from copies
where type = 'dubbed' AND (id,MovieID) NOT IN (select id,MovieID from Bookings))
Which I am basically trying to delete all the 'dubbed' copies in one table of mine which were never booked/reserved. When I execute the query, it is informed that:
An expression of non-boolean type specified in a context where a condition is expected, near ','.
I know that this query runs fine in PostgreSQL, but I am experiencing problems to execute it at SQL Server 2012. What should I do here?