derbycreatequery

create table table1 as select .. from sysibm.sysdummy1


In DERBY,

I have a table which name is TEST1. I can run this code perfectly.

CREATE TABLE Table1 AS (SELECT * FROM TEST1) with no data

But I can't run this code and derby.

CREATE TABLE Table1 AS (SELECT ..... FROM sysibm.sysdummy1) with no data

editor throws this error :

ERROR: The CREATE TABLE statement does not include a column list.

ps: "SELECT ..... FROM sysibm.sysdummy1" works with no problem.

How can I create a table with using "select 'columns' from sysibm.sysdummy1" ?


Solution

  • in my first code

    CREATE TABLE Table1 AS (SELECT ..... x, y, z , 0 FROM sysibm.sysdummy1) with no data
    

    I deleted comma and 0 in query and fixed it! Like that

    CREATE TABLE Table1 AS (SELECT ..... x, y, z FROM sysibm.sysdummy1) with no data