Debian Codegraph @

doc/sql.extensions/README.distinct

raw
1 ------------------
2 DISTINCT predicate
3 ------------------
4
5 Function:
6 Specify a test of whether two row values are distinct.
7
8 Author:
9 Oleg Loa <[email protected]>
10 Dmitry Yemanov <[email protected]>
11
12 Syntax rules:
13 <value> IS [NOT] DISTINCT FROM <value>
14
15 Scope:
16 DSQL, PSQL
17
18 Example(s):
19 1. SELECT * FROM T1 JOIN T2 ON T1.NAME IS NOT DISTINCT FROM T2.NAME;
20 2. SELECT * FROM T WHERE T.MARK IS DISTINCT FROM 'test'
21
22 Note(s):
23 1. A DISTINCT predicate evaluates very similar to an equality predicate with
24 the only difference that two NULL values are considered not distinct. As a result,
25 this predicate never evaluates to UNKNOWN truth value (the same as IS [NOT] NULL
26 predicate behaves).
27 2. The NOT DISTINCT predicate can be optimized via an index, if exists.