I'm fascinated.....I am working with Lynn's code.
Say I wanted certain clients those whose ClientID was < than 3.
Clearly I can add any conditions to the final SELECT statement but performance would suffer if I had a multitude of clients.
Can I filter on the CTE?
I tried the following but did not get the expected results.
WHERE
(s1.ClientID IS NULL OR s1.ClientID < 3)
OR
(s2.ClientID IS NULL OR s2.ClientID < 3)
I appreciate the input. Obviously these are not real tables and data, just an abstraction of my real problem. Sometimes I over simplify things and don't anticipate all my needs. Bust since I am not exposing real data or data structure I get to keep my job! 😀
I am also wondering if I should solve each problem (new and lost) separately and union the results...