Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

moving rows from one table to another 1

Status
Not open for further replies.

miraclemaker

Programmer
Oct 16, 2002
127
GB
Hi there. Is there some kind of query that will allow me to move / export some rows from one table to another in the same database?

Thanks
 
yes

first, copy the rows from table1 into table2 like this --
Code:
insert 
  into table2
     ( foo2
     , bar2
     , qux2
     )
select foo
     , bar
     , qux
  from table1
 where pk1 in ( 1, 3, 5, 937 )
then delete them from table1 --
Code:
delete
  from table1
 where pk1 in ( 1, 3, 5, 937 )


rudy
SQL Consulting
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top