By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,710 Members | 1,613 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,710 IT Pros & Developers. It's quick & easy.

How to insert multiple rows with a single INSERT.

P: n/a
Hi,
I would like to know how to insert multiple rows into a table, using a
single INSERT statement. My requirement is like this I have a table ABC
which contains multiple employees entries with empId as the primary key.
Now I want to insert the all the empid multiplied by X and y (<EMPID>*x*y)
into a table DEF plus filling other columns for each employee rows.

Table ABC
---------
EMPID QQQ LLL MMM
1 5 "L" 20
4 45 "J" 43
6 63 "Q" 89

The table DEF need to be populated from ABC as below
Table DEF
---------
EMPIDMOD KKK MMM
1*X*Y 0 786
4*X*Y 0 786
6*X*Y 0 786
Thanks,
Tuhin
Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"Tuhin Kumar" <tk****@ipolicynet.com> wrote in message
news:e4**************************@posting.google.c om...
Hi,
I would like to know how to insert multiple rows into a table, using a
single INSERT statement. My requirement is like this I have a table ABC
which contains multiple employees entries with empId as the primary key.
Now I want to insert the all the empid multiplied by X and y (<EMPID>*x*y)
into a table DEF plus filling other columns for each employee rows.

Table ABC
---------
EMPID QQQ LLL MMM
1 5 "L" 20
4 45 "J" 43
6 63 "Q" 89

The table DEF need to be populated from ABC as below
Table DEF
---------
EMPIDMOD KKK MMM
1*X*Y 0 786
4*X*Y 0 786
6*X*Y 0 786
Thanks,
Tuhin


Insert into DEF
(EMPID
,MOD
,KKK)
SELECT EMPID*x*y
, 0
, 786
FROM ABC;

ieVel
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.