WL#3003: SQL:2003 DISTINCT predicate

Affects: Prototype Only   —   Status: Un-Assigned   —   Priority: Medium

This is (AFAIK) a NULL-safe operation, and we may be able to support this syntax
by using a [NOT] <=> operation internally.

These are SQL:2003 features T151 (DISTINCT predicate) and T152 (DISTINCT
predicate with negation)

<distinct predicate>


Specify a test of whether two row values are distinct


<distinct predicate> ::=
<row value predicand 3> <distinct predicate part 2>

<distinct predicate part 2> ::=
IS [ NOT ] DISTINCT FROM <row value predicand 4>

<row value predicand 3> ::= <row value predicand>

<row value predicand 4> ::= <row value predicand>

Syntax Rules

1) The two <row value predicand>s shall be of the same degree.
2) Let respective values be values with the same ordinal position.
3) The declared types of the respective values of the two <row value predicand>s
shall be comparable.
4) Let X be the first <row value predicand> and let Y be the second <row value
5) Each field of each <row value predicand> is an operand of an equality operation.
6) If <distinct predicate part 2> immediately contains NOT, then the <distinct
predicate> is equivalent to: NOT ( X IS DISTINCT FROM Y )

General Rules

1) The result of <distinct predicate> is True if the value of <row value
predicand 3> is distinct from the value of <row value predicand 4>; otherwise,
the result is False.

2) If two <row value predicand>s are not distinct, then they are said to be
duplicates. If a number of <row value predicand>s are all duplicates of each
other, then all except one are said to be redundant duplicates.