Skip to content
Loading
  • Rajanikant Hawaldar
    0
    1. select *   
    2.  from #trades  
    3.  where partid in (  
    4.  select partid from #trades group by partid having count(*)=1)   
    5.  and PartId not in   
    6.  ( select PartId from #trades a ,#mapping b   
    7.  where a.CodeTypeId  between iif(CodeTypeFrom>CodeTypeTo,CodeTypeFrom,CodeTypeTo) and iif(CodeTypeFrom>CodeTypeTo,CodeTypeTo,CodeTypeFrom))  
    8.  and CodeTypeId=3030  
    0