Oracle Error Message
ORA-02440: Create as select with referential constraints not allowed
Reason for the Error
create table foo (… ref. con. …) as select …;
Solution
Create the table as select, then alter the table to add the constraints afterwards.