I have a unique situation. I would like to be able to do a select statement to do some testing. I have 3 tables to join, however the middle table is only a cross reference table and does not always exist. Here is some generic psuedo code to try to explain:
Also look at this post for some more information:
http://www.progresstalk.com/showthread.php?t=114758
Code:
select field1, field2, count(*)
from table1
join table2 on table2.field1 = table1.field1
join table3 on table3.field1 = if exists table2.field1 else table1.field1 group by field1, field2
Also look at this post for some more information:
http://www.progresstalk.com/showthread.php?t=114758