Hello Can I replace this query: FROM (SELECT L.LOAN_ID, L.LOAN_NUM, L.PORTFOLIO_ID, L.STS_ID FROM LS_LOAN L WHERE L.PORTFOLIO_ID IN (2, 3)) L2 with this? FROM LS_LOAN L WHERE L.PORTFOLIO_ID IN (2, 3) INNER JOIN L2 ON L2.PORTFOLIO_ID = L.PORTFOLIO_ID Thank you.
Yes, however you have to do the JOIN prior to the WHERE clause. FROM LS_Loan L INNER JOIN LS_Loan L2 on L.Portfolio_ID = L2.Portfolio_ID WHERE L.Portfolio_ID IN (2,3) I suspect the query plans would be different but the results should be the same. Hope that helps!