I have a query to join 2 tables in the following way.
Table1 has a field (LinkTo) that may (or may not) appear in one of three fields in table Table2 (Link, Link1, Link2). I need try joining LinkTo to Link, then Link1 then Link2. As soon as I match on one (say Link1) I should stop trying to join.
Thanks
Mark
This might be what you are looking for. It joins in the order of fields you mentioned (edited to answer a question from the comments):
Note, I don’t know whether you need a
LEFT OUTERjoin or not… In any case, you should be aware of a potentially very slow execution plan with this…