Skip to content

DB::Exception: Different number of columns in UNION ALL elements #2083

Closed

Description

@StarWix

Union all is not working when in subquery has column with different aliases:

CREATE TABLE test(x Int32) ENGINE = Log;

SELECT a1 
FROM
(
    SELECT x AS a1, x AS a2 FROM test
    UNION ALL
    SELECT x, x FROM test
)

Error:

Received exception from server (version 1.1.54370):
Code: 258. DB::Exception: Received from localhost:9000, 127.0.0.1. DB::Exception: Different number of columns in UNION ALL elements.

Activity

  1. ztlpn commented on Mar 21, 2018

    @ztlpn
    Contributor

    Confirmed.

  2. added
    bug
    on Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions