Skip to content
Advertisement

Replace NOT IN with LEFT JOIN in SQL statement

I wrote two queries which are working fine, but they are really really slow:

I tried to replace NOT IN with INNER JOIN and LEFT JOIN but nothing I have tried worked so far.

Following is schema for the tables:

movies:

stars:

stars_in_movies:

Thank you in advance.

Advertisement

Answer

Try this:

the second query

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement