How to replace OR statment on revision by another best practise and more performance ?
I work on SQL server 2012 I face issue I need to use any thing alternative or best from using OR statement multiple time .
so How to use any solution without Using OR statement on Revision
with another meaning I need to replace that by any thing best practise and more performance
- isnull(f.Revision_ID,'')=isnull(m.Revision_Id,'')
- OR isnull(f.revision_id,'') = isnull(m.ReflowTemperatureSource_Revision_Id,'')
- OR isnull(f.revision_id,'') = isnull(m.[MSLSource_Revision_id],'')
- OR isnull(f.revision_id,'') = isnull(m.Revision_Id,'')
- OR isnull(f.revision_id,'') = isnull(m.[ShelfLifeRevisionID],'')
- OR isnull(f.revision_id,'') = isnull(m.[BaseMaterialRevisionID],'')
- OR isnull(f.revision_id,'') = isnull(m.[WaveTemperatureSource_Revision_ID],'')
- SELECT TOP 1000000
- p.PartNumber PartNumber ,
- c.CompanyName CompanyName ,
- reflowv.online_url ReflowTemperatureSourceOnline ,
- reflowv.local_url ReflowTemperatureSourceOffline ,
- m.Comment
- FROM #TempPC t
- inner join #final f on t.RevisionID=f.Revision_Id
- LEFT JOIN Parts.ManufacturingData m WITH(NOLOCK) ON isnull(f.Revision_ID,'')=isnull(m.Revision_Id,'')
- OR isnull(f.revision_id,'') = isnull(m.ReflowTemperatureSource_Revision_Id,'')
- OR isnull(f.revision_id,'') = isnull(m.[MSLSource_Revision_id],'')
- OR isnull(f.revision_id,'') = isnull(m.Revision_Id,'')
- OR isnull(f.revision_id,'') = isnull(m.[ShelfLifeRevisionID],'')
- OR isnull(f.revision_id,'') = isnull(m.[BaseMaterialRevisionID],'')
- OR isnull(f.revision_id,'') = isnull(m.[WaveTemperatureSource_Revision_ID],'')
- LEFT JOIN [Z2URLSystem].[zsrc].[core_view] reflowv WITH(NOLOCK) ON isnull(reflowv.revision_id,'') = isnull(m.ReflowTemperatureSource_Revision_Id,'')
- LEFT JOIN Parts.Nop_Part p WITH(NOLOCK) ON p.partid=m.partid
- LEFT JOIN #Values va ON va.partid = p.PartID
Replies
Know the answer? Post it — somebody with the same question will find it here.