insert Multiple rows into the table from that table data


Posted on 16th Feb 2014 07:03 pm 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

No comments posted yet

Your Answer:

Login to answer
99 Like 13 Dislike
Previous forums Next forums
Other forums

Shuffle between users ??
I have multiple $users in table. I need to send them $message.

I need to send the next messag

Help please - How to validate from 2 possible answers
Hi

I hope somebody can help me with what will probably be really simple, I'm pulling my hair

RTF fomatting to email content
Im trying to sen an email with content is picked up from a rtf-file (file_get_contents('*.rtf'). Mai

Transferring session variables into MySQL
I am trying to transfer $_SESSION variables into MySQL. However there is an error in my MySQL statem

Filename and Line Number Custom Error
I have a class, with a method that accepts 2 parameters. I would like to output error messages.

Count of reciepients in php mailer
How can i sent a mail to large no of reciepients say 10,00,00 Using PHP MAILER

Retrieving innerHTML with cURL?
Hey all (sorry I know I'm a leecher, but I soon won't be. This is my first PHP project, but not my l

Sufficient protection from bad input?
I am writing a simple script to let people upload 'pages' of their own content, be it simply a few b

Filtering for a phrase using pregmatch
Here is my code which looks for addresses which start with ' src=" '

Code: [Select]preg_

j1inmis Ouput layout changes
Hi,

Can anybody tell how can j1inmis output layout can be changed so that vendor names ge

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash