Hi,

Bad news: there's a current (as of version 10.5) limitation of CREATE ... SELECT in Derby that only allows one to create the /structure/ of the table, but not to insert the data in the same statement:
CREATE TABLE abc AS SELECT * FROM bcd WITH NO DATA
                                      ^^^^^^^^^^^^
(the WHERE clause is useless since we are not copying any row)


Good news: there is an INSERT ... SELECT statement that does the job
INSERT INTO abc SELECT * FROM bcd WHERE NAME='ABC'


As a conclusion, you will need both statements.

Ref:
http://db.apache.org/derby/docs/10.5/ref/rrefsqlj24513.html
http://db.apache.org/derby/docs/10.5/ref/rrefsqlj40774.html


I hope this helps,
Sylvain

MilindK007 a écrit :

Hi guys can any one please help me for modifying below mentioned sql script
so that i can run it in derby database.
create table abc as select * from bcd where name='ABC'
Please help...


--
[email protected]
http://www.chicoree.fr


Reply via email to