• Hi Steve,

    Fortunately, I had kept my query window open over the day!

    With the clarification that first = leftmost (my first assumption) and the additional hint that the red house (office) is in the middle, I still get three solutions with the green offfice directly left of the white office, and even four solutions with the green office "somewhere to the left" of the white office.

    In both lists, the 19" Dual monitor can be in Sue's, Andy's, or Brian's office.

    (Just run the SQL I included in my first post, with this additional line for the Combinations view:

    AND

    NOT (Office = 3 AND Color <> 'red') -- The red house (office) is in the middle.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/