Home Forums SQL Server 2005 Development Query difference: HOw to Avoiding UNION ALL with correlated Query RE: Query difference: HOw to Avoiding UNION ALL with correlated Query

  • Bhuvnesh (1/11/2010)


    sample data is not possible , as it includes amny tables

    yes row count is correct and time taken = 18 secs

    but my concerns is UNION ALL with same tables

    i want to replace it with correlated query.

    The row count is correct: are there any differences between the results of your first query and my query?

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden