• GilaMonster (11/12/2012)


    SQLSACT (11/12/2012)


    When using in adding a correlation predicate is redundant?

    Written correctly, just about all the time. Please read that blog post and maybe BoL on how the IN function works

    Am I on track here?

    select T1.Col1 from T1

    where T1.Col1 in

    (select Col1 from T2 where T2.Col1 = T1.Col1)

    No, I gave you the correct form in my previous post.

    --2

    select T1.Col1 from T1

    where T1.Col1 in (select Col1 from T2)

    Think about what the IN does with the two columns specified and you should understand why the correlation is completely unnecessary.

    Thanks

    I see now why it's unnecessary

    When I asked "am I on track here" followed by the query. I was just confirming that that query was incorrect based on my Layman's terms.

    Thanks