A predicate is specified in a WHERE condition in a statement which is "true", "false", or "unknown". The result is generated by applying the predicate to a specific row in a result table (see result table name) or to a group of rows in a table that was formed by the GROUP clause.
<predicate> ::=
<between_predicate> | <bool_predicate> |
<comparison_predicate>
| <default_predicate> | <exists_predicate> |
<in_predicate>
| <join_predicate> | <like_predicate> | <null_predicate>
| <quantified_predicate> | <rowno_predicate> |
<sounds_predicate>
between_predicate, bool_predicate, comparison_predicate, default_predicate, exists_predicate, in_predicate, join_predicate, like_predicate, null_predicate, quantified_predicate, rowno_predicate, sounds_predicate
· Columns in a table with the same code attribute can be compared.
· Columns with the different code attributes ASCII and UNICODE can be compared.
· Columns with the code attribute ASCII or UNICODE can be compared with date values, time values, or timestamp values.
· LONG columns can only be used in the NULL predicate.
Example table: customer
Selection without a condition:
SELECT city, name, firstname FROM customer
CITY |
NAME |
FIRSTNAME |
New York |
Porter |
Jenny |
Dallas |
DATASOFT |
? |
Los Angeles |
Porter |
Martin |
Los Angeles |
Peters |
Sally |
Hollywood |
Brown |
Peter |
New York |
Porter |
Michael |
New York |
Howe |
George |
Los Angeles |
Randolph |
Frank |
Los Angeles |
Peters |
Joseph |
Los Angeles |
Brown |
Susan |
Los Angeles |
Jackson |
Anthony |
Los Angeles |
Adams |
Thomas |
New York |
Griffith |
Mark |
Los Angeles |
TOOLware |
? |
Hollywood |
Brown |
Rose |
Auswahl mit einschränkender Bedingung:
SELECT city, name, firstname FROM customer
WHERE city = 'Los Angeles'
CITY |
NAME |
FIRSTNAME |
Los Angeles |
Porter |
Martin |
Los Angeles |
Peters |
Sally |
Los Angeles |
Randolph |
Frank |
Los Angeles |
Peters |
Joseph |
Los Angeles |
Brown |
Susan |
Los Angeles |
Jackson |
Anthony |
Los Angeles |
Adams |
Thomas |
Los Angeles |
TOOLware |
? |