--handpicked 8 products and two products, one from MFR and the other from CHO, have the same SKU select * from tbl_OFS_FlatSearch where uniqueId in ( 9179601,9141958,9142005,9142008,9187238,9187239,9187240 ) select * from tbl_OFS_FlatSearch where uniqueId in ( 9179601,9141958,9142005,9142008,9187238,9187239,9187240 ) and ( sku not in ( select cho.sku from tbl_OFS_FlatSearch cho where cho.skuOwnerType = 'CHO' and cho.uniqueId in ( 9179601,9141958,9142005,9142008,9187238,9187238,9187239,9187240 ) ) or skuOwnerType <> 'MFR' ) order by skuOwnerType select * from tbl_OFS_FlatSearch where uniqueId in ( 9179601, 9187238 ) and skuOwnerType <> 'MFR'