Advertisement

03.29.2008 at 06:29PM PDT, ID: 23280179
[x]
Attachment Details

How do I list multiple values I want to query?

Asked by vsllc in SQL Query Syntax

This may seem like a very simple question but how do I write an easy select statement to pull more than 1 value?  For example let's say I want to query the Sales file where Regions = 1, 3, 6 or 7.  Currently my select statement looks like this:

select * from sales where regions = 1 or regions = 3 or regions = 6 or regions = 7

This works but I'm sure there must be a better way.Start Free Trial
[+][-]03.29.2008 at 06:37PM PDT, ID: 21239075

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.

 
[+][-]03.29.2008 at 06:38PM PDT, ID: 21239080

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.

 
[+][-]03.29.2008 at 06:39PM PDT, ID: 21239091

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: SQL Query Syntax
Sign Up Now!
Solution Provided By: laneduncan
Participating Experts: 3
Solution Grade: A
 
 
[+][-]03.30.2008 at 04:45AM PDT, ID: 21240357

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.

 
[+][-]04.01.2008 at 07:54PM PDT, ID: 21259864

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.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628