Skip to content

INTERSECT ALL and EXCEPT ALL are parse errors #2801

Open

Description

@mathiasrw

INTERSECT ALL and EXCEPT ALL are parse errors. UNION ALL, INTERSECT and EXCEPT work.

Seen in the NIST SQL Test Suite run: 8 checks in dml164.sql and yts762.sql. Reproduced on develop (38bf3c3):

alasql('CREATE TABLE a (x INT)');
alasql('INSERT INTO a VALUES (1), (1), (1), (2)');
alasql('CREATE TABLE b (x INT)');
alasql('INSERT INTO b VALUES (1), (1), (3)');
alasql('SELECT x FROM a INTERSECT ALL SELECT x FROM b');   // Parse error
alasql('SELECT x FROM a EXCEPT ALL SELECT x FROM b');      // Parse error

Expected: INTERSECT ALL keeps each row as often as it appears in both, so 1, 1. EXCEPT ALL subtracts the counts, so 1, 2.

Breaking?

No. Today these are parse errors.

Related: #2718 (set operations as a tree), #2744, #2745.

Activity

  1. modified the milestones: v5.x Focus, v5.0.0 on Oct 22, 2026
  2. mateuscmtropical commented on Nov 11, 2026

    @mateuscmtropical
    Contributor

    Hi, I'd like to work on this one.

  3. mateuscmtropical commented on Nov 11, 2026

    @mateuscmtropical
    Contributor

    Hi, I've opened a PR for this: #3027

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions