SQL/MX Quick Start (G06.24+, H06.03+)
HP NonStop SQL/MX Quick Start—523724-002
3-1
3
Stating Conditions for Selecting
Data
This section provides information about how to use predicates in a WHERE clause.
Using Predicates to Select Data
In some of the previous examples, one value is compared to another value by using a
comparison operator: for example, the equal sign (=). A comparison operator is one
type of SQL predicate.
Examples that illustrate predicates are:
Predicate Example Meaning
= PARTNUM = 4130 Part number equal to 4130
< ORDERNUM < 200000 Order number less than 200,000
<= QTY_AVAILABLE <= 5 Quantity available less than or equal
to 5
> DELIV_DATE >
DATE '2003-12-31'
Delivery date later than
2003-12-31
>= ORDER_DATE >=
DATE '2003-01-01'
Order date later than or equal to
2003-01-01
<> PARTNUM <> 4130 Part number not equal to 4130
IS NULL PARTDESC IS NULL Part description is null
IS NOT NULL PARTDESC IS NOT NULL Part description is not null
BETWEEN PARTNUM BETWEEN 3000
AND 4000
Part number is between 3000 and
4000 and includes 3000 and 4000
IN PARTNUM IN (4130, 6603, 212) Part number is one of 4130, 6603, or
212
LIKE PARTDESC LIKE
'%PRINTER%'
Part description has the text string
PRINTER