Skip to content
Advertisement

Exclude Records Based on Criteria

I need to exclude the record:

  1. If a customer bought “Shoe” and “Hat” on the same day, exclude the record with “Hat”.
  2. If a customer bought “Shoe” and “Cloth” on the same day, exclude the record with “Cloth”.

Here is the sample data:

Here are the expected results:

enter image description here

Advertisement

Answer

Self join to your shoe criteria and make sure it is not there, like this:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement