Menu

#1567 'duplicate column name in derived table' when using wildcard

version 2.5.x
closed-invalid
None
5
2020-02-21
2020-02-19
No

Please create a simple table such as
CREATE TABLE PUBLIC.DEMO(TEXT VARCHAR(1024) PRIMARY KEY);
Then try
SELECT *, LENGTH(TEXT) FROM DEMO;
And there is an error
'duplicate column name in derived table'.

Discussion

  • Fred Toussi

    Fred Toussi - 2020-02-19

    When you use the unqualified wildcard, you cannot add another column to the SELECT list. Qualified wildcards are allowed multiple times or in addition to other columns.

    SELECT DEMO.* , LENGTH(TEXT) FROM DEMO;

     
  • Richard Thomas

    Richard Thomas - 2020-02-20

    Alright thanks. I thought that was allowed in SQL.

     
  • Fred Toussi

    Fred Toussi - 2020-02-21
    • status: open --> closed-invalid
    • assigned_to: Fred Toussi
     

Log in to post a comment.