Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL sintax trouble

Author  Topic 

gio123bg
Starting Member

5 Posts

Posted - 2009-06-05 : 05:50:23
Hi all,
I wish to move a data selected from a table in a new table but where the first two fields must be constant.

Example

select 'A' 'BBB' T1.f3 T1.f4
from table T1
where ...

In this way:

A BBB ccc ddd
A BBB fff hhhh
A BBB sss kkkk

Any help will be well appreciated.
Thanks in advance.
Regards,

Giovanni

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-06-05 : 06:04:25
[code]
insert into new_table (col1, col2, col3, col4)
select 'A', 'BB', T1.f3, T1.f4
from table1 T1
[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

gio123bg
Starting Member

5 Posts

Posted - 2009-06-05 : 07:13:52
Thanks a lot for your support.
Go to Top of Page
   

- Advertisement -