Reversed In?

  • If this is covered somewhere else, sorry I did search though 🙂

    I was looking for a specific value across multiple columns in the same table and thought I'd try using the traditional in statement in reverse.

    select * from [some table] where 'X' in(col1, col2, col3);

    It seems that the compilier just boils INs to ORs?

  • raohtheconquerer (1/11/2013)


    It seems that the compilier just boils INs to ORs?

    Yup, and it does that whether it's column IN (1,2,3) or 1 IN (Col1, Col2, Col3)

    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

Viewing 2 posts - 1 through 1 (of 1 total)

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