aakar Ответов: 1

Справка по SQL-запросу-выберите таблицу для объединения на основе условия.


,

I have 2 tables TableA and TableB that we use for reporting purposes. We join these tables with other tables & select the FundName column from these.
TableA has some funds that are exclusive to TableA only (i.e. they are not present in TableB)
Also, TableB has some funds that are exclusive to TableB only (i.e. they are not present in TableA)
Finally, there are some funds that are common in both TableA as well as TableB.
I need a join query that first looks for the funds in TableA. If the corresponding Fund does not exist in TableA, then we join the earlier tables in the query with TableB.


Что я уже пробовал:

Я пробовал использовать оператор EXCEPT, но он, похоже, не работает.
y help will be very much appreciated.

Thanks,
Aakar.

1 Ответов

Рейтинг:
2

Peter Leow

Ключ к решению вашей проблемы лежит здесь Визуальное представление SQL-соединений[^]