Home Forums SQL Server 2005 Administering How to write Query on the Result Set of Another Query RE: How to write Query on the Result Set of Another Query

  • perireddy.arikatla (10/10/2013)


    Hai Every One. Can Any body help me Please.

    I Want to Write a Query On the Result Set Of Another Query.

    How to Write

    Can Any body help me Please.

    There are a lot of ways to do this. Koen's code demonstrates a "Derived Table". There are other methods, as well.

    CTE

    Derived Tables (Sub-queries)

    Correlated Sub-Queries

    Views

    Inline Table Valued Functions

    APPLY (CROSS or OUTER)

    Temp Tables

    INSERT/EXEC

    OpenRowSet

    OpenDataSource

    --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)