This is just a generic question.
I have a CTE1 that takes a parameter. It has a dense rank in the select statement and RN<5 in the where statement, so that essentially it runs 5 times and gives me a set of results. So it spits out 101,102,103,104,105.
I have another CTE2. that can check some conditions and gives me a result.
Essentially I want CTE1 to do its thing and give me my five numbers, then I want to send each number (from those results) to CTE2 and for each number do its check and give me a result on that.
In the end I would have something like 101 - true 102 - true 103 - false 104 - true 105 - true
Is this possible?
I have tried multiple CTE versions with subcte's and recursive and it just seems like it isn't possible.