background image
<< Boolean expressions | Dynamic parameters >>

Explanation and Example

<< Boolean expressions | Dynamic parameters >>
Derby Reference Manual
98
Operator
Explanation and Example
Syntax
an optional escape character, which
you specify with the ESCAPE clause.
SELECT a FROM tabA WHERE a
LIKE '%=_' ESCAPE '='
Note: When LIKE comparisons are
used, Derby compares one character
at a time for non-metacharacters.
This is different than the way Derby
processes = comparisons. The
comparisons with the = operator
compare the entire character string
on left side of the = operator with
the entire character string on the
right side of the = operator. For more
information, see Character-based
collation in Derby
in the Derby
Developer's Guide
.
BETWEEN
Tests whether the first operand
is between the second and third
operands. The second operand
must be less than the third operand.
Applicable only to types to which <=
and >= can be applied.
WHERE booking_date BETWEEN
DATE('1998-02-26') AND
DATE('1998-03-01')
Expression [ NOT ]
BETWEEN Expression
AND Expression
IN
Operates on table subquery or list
of values. Returns TRUE if the left
expression's value is in the result of
the table subquery or in the list of
values. Table subquery can return
multiple rows but must return a single
column.
WHERE booking_date NOT IN
(SELECT booking_date FROM
HotelBookings WHERE
rooms_available = 0)
{
Expression [ NOT ]
IN
TableSubquery
|
Expression [ NOT ]
IN ( Expression
[, Expression ]*
)
}
EXISTS
Operates on a table subquery.
Returns TRUE if the table subquery
returns any rows, and FALSE if it
returns no rows. Table subquery can
return multiple columns (only if you
use * to denote multiple columns) and
rows.
WHERE EXISTS
(SELECT *
FROM Flights
WHERE dest_airport = 'SFO'
AND orig_airport = 'GRU')
[NOT] EXISTS
TableSubquery
Quantified
comparison
A quantified comparison is a
comparison operator (<, =, >, <=,
Expression
ComparisonOperator