Quote:
Originally posted by chrisrlong
Actually, jmodic was on the right track, as the analytical functions are your best bet, but before I get to the solution...
However, this can get extremely complicated if you do not know your ultimate result set. I mean, just because I pick 3 states that I know are in table B does not mean that those 3 states will appear in the final result set. Therefore, you would have to apply all the restrictive criteria just to get the distinct set of usable states, then re-join and re-restrict everything again to get the full results.
I did run into this problem of restricting twice with correlated query, I am trying with this analytic function will let you know the results