• Sachy123 - Thursday, March 21, 2019 4:53 AM

    drew.allen - Friday, March 15, 2019 12:26 PM

    You're also confused about the meaning of recursion.  Recursion is when one CTE refers to itself, not when one query references another.  Even if you use a CTE, I see no reason to make it recursive.

    Drew

    but I would like it to dynamically take one value of date from Query 1 and then append the results .. I thought CTE can help.
    IHow can I then reform my query? use "in" clause?

    I suggest you post the actual queries so that people can help you.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)