Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> 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! Received on Thu Dec 15 2005 - 14:18:36 CST