January 11, 2013 at 2:44 pm
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?
January 11, 2013 at 2:53 pm
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
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply