added a mechanism to notify if the sub query is EXISTS or NOT EXISTS.

This information will be used to generate the correct combination
of rows across main and the sub queries.