• As you said,

    My business logic is:

    So you have two diffferents sets of business rules here.

    1) All three columns must match

    2) At least one column must match

    karthik