[QUOTE][i]Originally posted by chrisrlong [/i]
[B]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.
[/B][/QUOTE]

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
And perfomance is very important in this query because it´s a search engine query so basically it will be called again and again with different crititerias

Cheers

[Edited by pando on 03-07-2001 at 03:50 AM]