Intersection of a set of queries in a cursor

Tools & Utilities
Enthusiast

Intersection of a set of queries in a cursor

Hello all,
I am trying to code a cursor/procedure as follows,
I have a set of queries . The queries differ only by a single variable value.
An example would be ..
select * from ABC where X = 'Y' & U = 'V'
select * from ABC where X = 'Y' & U = 'M'

The variable U is a column in another table , which I will join in the cursor.

At the moment my query loosk like ,

select * from ABC where X = 'Y' & U = 'V'
INTERSECT
(
select * from ABC where X = 'Y' & U = 'M'
INTERSECT
(
select * from ABC where X = 'Y' & U = 'N'
)
)

I want to do this intersection 'n' number of times , until all distinct values of the column 'U' have been tested .
For this I plan to use a cursor/ procedure.
However , i am finding it difficult to implement the query .
Any suggestions...

Regards,
az_maverick