homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

Searching value from multiple columns

5+ Year Member

Msg#: 4243025 posted 9:44 am on Dec 16, 2010 (gmt 0)

Browsed (googled) around with this question but could not find a definitive answer...

I have 20 columns containing numbers. All numbers are unique in row.
How can I find all the rows containing single value, that can be in any of the 20 columns?

This far I have only seen solutions like
WHERE col1=1 OR col2=1 OR col3...

While I can produce these queries without breaking a sweat with code, in my eternal quest for knowledge and more elaborate (efficient) solutions I present my question to you: Really, no other way than the one mentioned above?

Thanks for any input!



WebmasterWorld Senior Member whoisgregg us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 4243025 posted 1:56 pm on Dec 29, 2010 (gmt 0)

No other way that I know of. :)

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved