Re: How to insert multiple rows with a single INSERT.

From: Ievel <ievel{-removeit-}_at_skynet.be>
Date: Tue, 15 Jul 2003 00:25:12 +0200
Message-ID: <3f132dc8$0$275$ba620e4c_at_reader0.news.skynet.be>


"Tuhin Kumar" <tkumar_at_ipolicynet.com> wrote in message news:e4ad76f5.0307140435.388f36ca_at_posting.google.com...
> 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 Received on Tue Jul 15 2003 - 00:25:12 CEST

Original text of this message