Advertisement

05.09.2008 at 09:15AM PDT, ID: 23389958
[x]
Attachment Details

search a value in multiple columns!

Asked by qinyan in MS SQL Server

We have a table which have 35 different option fields the column headings are o1, o2, o3,...o35. If I'm looking for a particular option code do I have to enter each column in my query like:
where (o1='L6' or o2='L6' or 03='L6'&or o35='L6')?  The problem is that the option code 'L6' could be in any of the 35 columns. Is there any other better way than type the 35 column names? Thanks!

Start Free Trial
[+][-]05.09.2008 at 09:17AM PDT, ID: 21534347

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 09:40AM PDT, ID: 21534551

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 09:43AM PDT, ID: 21534566

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 09:51AM PDT, ID: 21534639

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 10:18AM PDT, ID: 21534857

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.09.2008 at 01:49PM PDT, ID: 21536323

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MS SQL Server
Sign Up Now!
Solution Provided By: ScottPletcher
Participating Experts: 3
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628