insert Multiple rows into the table from that table data

Posted on 16th Feb 2014 by admin

Hi All,

I have a requirement like to insert mulitple rows into the table from that table data only(I need to replicate the data).
In this table primary key is composite primary key with all foreign keys.primary key also including the Date foreign key.I need to change that date at the of insertion.
INSERT
INTO myschema.Fact_page_performance
(
time_sk ,
batch_id ,
delta_msec ,
delta_user_msec,
error_code_sk ,
content_errs ,
element_count ,
page_bytes ,
Available ,
date_sk
)
VALUES
(SELECT time_sk ,
batch_id ,
delta_msec ,
delta_user_msec,
error_code_sk ,
content_errs ,
element_count ,
page_bytes ,
Available
FROM myschema.FACT_PAGE_PERFORMANCE_BACKUP
WHERE date_sk=20090509,20090510
);

But it is giving the error like missing Expression.
Could anyone please help to me.

Thanks

Other forums