• In what way was simple set logic unable to perform this operation? It looks like this could be solved with left outer joins and is null tests. I don't have the test db mentioned, so my > may be wrong, it could need to be a exclude1.Version

    left join Production.ProductVersion exclude2

    on p.ProductID = exclude2.ProductID

    and p.Version = exclude2.Version

    and p.MinorVersion > exclude2.MinorVersion

    left join Production.ProductVersion exclude3

    on p.ProductID = exclude3.ProductID

    and p.Version = exclude3.Version

    and p.MinorVersion = exclude3.MinorVersion

    and p.ReleaseVersion > exclude3.ReleaseVersion

    left join Production.ProductVersion exclude4

    on p.ProductID = exclude4.ProductID

    and p.Version = exclude4.Version

    and p.MinorVersion = exclude4.MinorVersion

    and p.ReleaseVersion = exclude4.ReleaseVersion

    and p.StandardCost > exclude4.StandardCost

    where exclude1.Version is null

    and exclude2.MinorVersion is null

    and exclude3.ReleaseVersion is null

    and exclude4.StandardCost is null

    [/code]