Examples of Search Condition
•
Select rows by using a search condition composed of three comparison predicates joined by
AND operators:
select O.ordernum, O.deliv_date, OD.qty_ordered
FROM sales.orders O,
sales.odetail OD
WHERE qty_ordered < 9 AND deliv_date <= DATE '1998-11-01'
AND O.ordernum = OD.ordernum;
ORDERNUM
----------
100210
100210
100210
100250
101220
--- 28 row(s) selected.
•
Select rows by using a search condition composed of three comparison predicates, two of
which are joined by an OR operator (within parentheses), and where the result of the OR
and the first comparison predicate are joined by an AND operator:
SELECT partnum, S.suppnum, suppname
FROM invent.supplier S,
invent.partsupp PS
WHERE S.suppnum = PS.suppnum
AND (partnum < 3000 OR partnum = 7102);
PARTNUM
-------
212
244
255
...
7102
--- 18 row(s) selected.
DELIV_DATE
QTY_ORDERED
----------
-----------
1997-04-10
1997-04-10
1997-04-10
1997-06-15
1997-12-15
...
SUPPNUM
SUPPNAME
-------
------------------
1
NEW COMPUTERS INC
1
NEW COMPUTERS INC
1
NEW COMPUTERS INC
10
LEVERAGE INC
3
3
6
4
3
Search Condition
249