I work on SQL server 2012 . I face issue when using in clause on query it make query very slow
and take too much time
so i need to rewrite statement with best practice and best performance ?
update t set t.status='You must not have Obslelence Code Part X AND C Both Active' from #TempReplacementImporter t inner join parts.lifecyclemaster m on m.ZpartID=t.PartIDC inner join parts.lifecyclemaster m2 on m2.ZpartID=t.PartIDX WHERE m.ZLC IN (37002,37003,37008,490621,490620) AND m2.ZLC in (37002,37003,37008,490621,490620) AND t.Obsolescence IS Not NULL AND t.status is null
so How to rewrite query above with good best practice ?