Re: copying/moving from one table to another
От | Jie Liang |
---|---|
Тема | Re: copying/moving from one table to another |
Дата | |
Msg-id | 39D250BC.ECAC0A10@ipinc.com обсуждение исходный текст |
Ответ на | copying/moving from one table to another (Joachim Trinkwitz <jtr@uni-bonn.de>) |
Список | pgsql-sql |
Hi, there, <p>I do not quite sure is this what you want? <p>1. if newtable(one you want save) does not exist: <br />select* into newtable from oldtable; <br />or <br />create table newtable as select * from oldtable; <p>2. if newtableexisted, you append some record into it: <br />insert into newtable select * from oldtable where clause; <br /> <p>Joachim Trinkwitz wrote: <blockquote type="CITE">Hi all, <p>is there a handy way to copy or (preferrably) move a wholerecord <br />from one table to another, equally structured table in the same DB? <p>Background: I have some tables whichhold information concerning our <br />staff, where people quite so often come and go, because their <br />employmentcontract is limited to a year or two. When deleting a <br />person in the DB, I don't want to lose this informationcompletely, <br />but I want to save it in a backup table. <p>I suppose this is a newbie question, maybe I amstirring me blind <br />somewhere ... <p>Greetings and thanks, <br />jaochim</blockquote><pre>-- Jie LIANG Internet Products Inc. 10350 Science Center Drive Suite 100, San Diego, CA 92121 Office:(858)320-4873 jliang@ipinc.com www.ipinc.com</pre>
В списке pgsql-sql по дате отправления: