What is "query correlation"

  • Quite simply: What is "query correlation"? I just don't understand the concept of what it means to have queries correlated. Any examples in laymen terms?

  • Here are two definitions one from Microsoft and the other an article.

    http://www.databasejournal.com/features/mssql/article.php/3485291/Using-a-Correlated-Subquery-in-a-T-SQL-Statement.htm

    http://msdn.microsoft.com/en-us/library/ms187638.aspx

    Kind regards,
    Gift Peddie

  • [font="Verdana"]When Inner query is joined with Outer query, it is called co-related query. and the relation is called as query co-relation

    Mahesh[/font]

    MH-09-AM-8694

  • Mahesh Bote (2/11/2009)


    [font="Verdana"]When Inner query is joined with Outer query, it is called co-related query. and the relation is called as query co-relation[/font]

    Only when the inner query contains a reference to the outer. It's possible to have subqueries that do not reference the outer. Those are not correlated.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • [font="Verdana"]

    GilaMonster (2/11/2009)


    Mahesh Bote (2/11/2009)


    [font="Verdana"]When Inner query is joined with Outer query, it is called co-related query. and the relation is called as query co-relation[/font]

    Only when the inner query contains a reference to the outer. It's possible to have subqueries that do not reference the outer. Those are not correlated.

    Yes, you are absolutely right. Thats why I have mentioned JOINED word specifically.

    Mahesh[/font]

    MH-09-AM-8694

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply