Skip to content
Advertisement

joining same table multiple times in Oracle

Hi I am tuning one legacy code. we have below 2 tables in a big query.

I have seen in from clause

first table has been used thrice and it has been outer joined with same column with same table.

Can above 3 lines be handled using fnd_currencies table only once. is there any smarter way to do that?

Advertisement

Answer

You can ensure that you only query fnd_currencies once by using a subquery factoring clause. That would look like this (and keeps @gordonlinoff happy by using ANSI 92 syntax):

Whether this will actually give you an improved execution time depends on the details of your data, which you haven’t vouchsafed to us.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement