How to get PartId from table #trades where it have parts that have only map from and not have map to depend on table #map ?
To and not have map From
depend on table #map ?
every part id must be found on table trades two times
first row for same part for map from code type from and code value from second row for same part for map to code type to and code value to
meaning every part must exist two time but if it exist as one time for part as map To code type and code value and not have map From code type and code value
then this
what I need to display because it not have map From
as example parts 1410,1445,1445,1485,1348,1850 have map To only so it must display
part 1348 no need to display or show because it have map from and map to
so How to write query on SQL server 2012 display parts from table trades that have map To only and not have map From depend on table #map ?