I'm attempting to figure out what's going on with an existing query that has numerous "set" operators. Various web searches and a cursory reading of the Teradata documentation have yielded no results.
Here's a pseudo-code version of the query I'm interested in:
SELECT column from table1
SELECT column from table2
SELECT column from table3
(select column from table 4)
SELECT column from table4
I'm primarily curious about how the MINUS is handled; does it eliminate rows only from the immediately previous SELECT from table3 or from the entire result set? Also, the parentheses in the MINUS statement are there in the code I'm inspecting.
Furthermore, I'm presuming that the final UNION is not in any way affected by the MINUS procedure.
I'm sure I could figure this out myself by creating some sample tables, but I don't have access to the database right now I've checked in PostgreSQL docs and read blogs. (trying to get some work done from home today).