I have the following:select distinct ID_CUSIP into #yadda from BBCusips go create unique index yadda_index on #yadda (ID_CUSIP) go use imcwharehouse select distinct(a.cusip) from ( select mh.Accountid,mh.cusip,ms.SecType,ms.SECTOR,ms.INDS_Code from MarshallFundsHoldings mh left join Metavante_SecurityMaster ms on mh.cusip = ms.cusip where mh.cusip not in ( --select ID_CUSIP from BBCusips select ID_CUSIP from #yadda ) ) as a go drop table #yadda
What I am trying to do is to identify the unique cusips that i get from :select distinct(a.cusip) from ( select mh.Accountid,mh.cusip,ms.SecType,ms.SECTOR,ms.INDS_Code from MarshallFundsHoldings mh left join Metavante_SecurityMaster ms on mh.cusip = ms.cusip where mh.cusip not in ( --select ID_CUSIP from BBCusips select ID_CUSIP from #yadda )
and find out which of those cusips I dont have in select ID_CUSIP from #yadda
The problem is I know that I have CUSIPS that are not in, but my results set keeps coming back with 0 recordsWhen i change the query to look @ cusips that are in instead of not in, it brings back 880 records when I have 950 records total in the table. I just don't understand why it doesn't bring back any results when I am looking for CUSIP (NOT IN). Any help would be greatly appreciated, sorry if this is confusing.