Wednesday, March 2, 2011

Insert some records selected from another table plus some other data in to a new table

Eg:
Select a,b,c from test;
insert into test_bak values (a,b,c,'ttt','123');
This 'ttt' and '123' should be repeated across selected rows.

Insert statement:

insert into test_bak
select a, b, c, 'ttt', '123'
from test;

No comments:

Post a Comment