Relative Content

Tag Archive for sqloracle21c

Best type of join to use

I’m having an issue with the below query with either filtering out rows that are needed, or including extra rows that aren’t desired (Depending on whether or not I use the OR condition below). I am LEFT OUTER JOINing PO_ATTRIBUTE_VALUES as their are some cases where there are some rows in PO_ATTRIBUTE_VALUES that are not in PO_LINES_ARCHIVE_ALL. The issue is in the final WHERE clause where I only return rows from PO_LINES_ARCHIVE_ALL LN with a LAST_UPDATE_DATE within the last two days, OR where the LAST_UPDATE_DATE from PO_ATTRIBUTE_VALUES is within the last two days. If I don’t use the ‘OR` condition then I am filtering out rows that are needed that are in the Outer joined table.