View Single Post

   
  #1 (permalink)  
Old 04-08-2008, 09:20 AM
grohrer@gmail.com
 
Posts: n/a
Default Please help me with a simple query!!!

I have a table which contains information regarding widgets. Each
widget has a Department Number and a Product Number.

I need to query the table for a specific set of widgets...about 100 in
all.

I'm familiar with the basic queries such as:

SELECT *
FROM projectTable
WHERE prodNum IN ('002312','023124','254124')

which works great if your only querying with a single specific field.

The only other method I know if is to do the following:

SELECT *
FROM projectTable
WHERE (deptNum = '01' AND prodNum = '002312') OR (deptNum = '02' AND
prodNum = '002314') OR .......

Using this method for a hundred widgets would make for a pretty sizable
query string.

Is there another method which is better and effecient?

Thanks in Advance!

Reply With Quote