Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Anders Altberg
  Where is Anders Altberg?
 Uppsala
 Sweden
 Anders Altberg
 To: shiva kumar
  Where is shiva kumar?
 Hyderabad
 India
 shiva kumar
 Tags
Subject: RE: copy rec frm one table to another
Thread ID: 189321 Message ID: 189348 # Views: 1 # Ratings: 0
Version: Visual FoxPro 8 Category: General VFP Topics
Date: Thursday, August 14, 2008 2:21:30 PM         
   


> how to copy records form one table to another table
> ex: table1 to table2
> table1 recs=1 2 2 3 3 4 5 6 7 8 8 8
> ans should copy to table2 1 2 3 4 5 6 7 8 (unique recs should be copied)
>
>
> Shiva


INSERT INTO Table2 SELECT DISTINCT * FROM Table1

assuming the table structures are identical.
Otherwise you have to list the matching columns:
 INSERT INTO Table1 (col1, col2) SELECT DISTINCT col25, col3 FROM Table1

-Anders

ENTIRE THREAD

copy rec frm one table to another Posted by shiva kumar @ 8/14/2008 12:00:45 PM
RE: copy rec frm one table to another Posted by surinder singh @ 8/14/2008 12:04:59 PM
RE: copy rec frm one table to another Posted by Anders Altberg @ 8/14/2008 2:21:30 PM