ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 254.8k

How to use exists on this sql statment ?

Feb 18 2021 11:03 AM
How to use exists on this sql statment ?
How to use Exists on this sql statement ?
  1. update m set m.rohsstatus=RHst.Name from #ManuFacture m  
  2.   
  3. inner JOIN Parts.ROHS Rhh WITH(NOLOCK) ON Rhh.ZPartID=m.PartID  
  4. inner JOIN Nop_AcceptedValuesOption RHst WITH(NOLOCK) on RHst.AcceptedValuesOptionID=Rhh.RoHSStatus AND RHst.AcceptedValuesID=911  
i need to update table ManuFacture where part id exist on Parts.ROHS
so i need it as below
update m set m.rohsstatus=RHst.Name from #ManuFacture m
where exists(select 1 from Parts.ROHS)

Answers (5)