Nested single SELECT which also regard the outer scopes