Please look at following image, I have explained my requirements in the image.
I can't use here WHERE UsageTypeid IN(1,2,3,4)
because this will behave as an OR
condition and fetch all records.
I just want those records, of first table, which are attached with all 4 ShipmentToID
.
All others which are attached with 3 or less ShipmentToID
s are not needed in result set.
Thanks.