Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mismatching number of columns in the output when using SELECT * FROM and tables have same-named columns. #40

Open
OndraZizka opened this issue Apr 8, 2021 · 0 comments

Comments

@OndraZizka
Copy link
Owner

If the source tables have columns of the same names,
then the output table has only 1 column for both.

That makes the 2nd (, 3rd, ...) column not fit into the output table.

Possible solution:
When using *, The columns in the output should be prefixed, either with the full name, or some (internal?) alias.

Example

SQL: INSERT INTO output (SELECT gc_42., cards. FROM gc_42 LEFT JOIN cards ON policyId = previous_pa_policy_id)

DB error: SQLSyntaxErrorException number of target columns does not match that of query expression

Tables and column types:

  • CARDS
    • CURRENCY CHARACTER VARYING
  • IKEA_GC_42
    • POLICY_NO BIGINT
    • CURRENCY CHARACTER VARYING
  • OUTPUT
    • POLICY_NO BIGINT
    • CURRENCY CHARACTER VARYING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant