Skip to content

better documentation for ALL versions of set operations #6695

Open
@RaduBerinde

Description

@RaduBerinde

Radu Berinde (RaduBerinde) commented:

The docs on set operations only mention this much on DISTINCT vs ALL:

By default, each of these comparisons displays only one copy of each value (similar to SELECT DISTINCT). However, each function also lets you add an ALL to the clause to display duplicate values.

The semantics of ALL are more complicated than this. For example, if the same row appears on the left side 5 times and on the right side 2 times, EXCEPT ALL would remove 2 of the 5 occurrences. Similarly INTERSECT ALL would keep 2 occurrences.

The doc should also make it more explicit that DISTINCT is the same with not specifying ALL/DISTINCT (e.g. EXCEPT is the same with EXCEPT DISTINCT).

Jira Issue: DOC-449

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions