July 1, 2009 at 12:20 am
Hi,
I am having a table with one column and 5 rows. i need to copy/insert these rows to another table with 2 columns in it.
How would i do that with an efficient way?
Ex:
tbSource
col
----
5
6
7
8
9
tbDestination
col1col2
-------------
Expected result should be
tbDestination
col1col2
------------
15
16
17
18
19
Thanks.
July 1, 2009 at 12:33 am
Hi,
The Sql code will be
insert into tbDestination
select 1,col from tbSource
July 1, 2009 at 12:35 am
descentflower (7/1/2009)
How would i do that with an efficient way?
Hi,
What you mean the efficient way???
create tbDestination
(
col1 int default as 1,
col2 int
)
insert into tbDestination (Col2)
select * from tbSource
create tbDestination
(
col1 int ,
col2 int
)
insert into tbDestination(1,Col2)
select * from tbSource
ARUN SAS
July 1, 2009 at 2:50 am
SELECT 1 'Col1',col 'Col2' INTO tbDestination FROM tbSource
July 1, 2009 at 2:53 am
Thanks for your help
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply