Copy Or Transfer Selected Records From One Table To Another Table?

2004-12-13 Thread Nick Baker
What is the most efficient way to copy or transfer selected records from 
one table to another table with the same structure?. I.e., all records 
within a certain date range.

Select and Insert seems be a very laborious method.

Thanks,

Nick


~|
Special thanks to the CF Community Suite Silver Sponsor - RUWebby
http://www.ruwebby.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187413
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Copy Or Transfer Selected Records From One Table To Another Table?

2004-12-13 Thread Joe Rinehart
Nick,

On most platforms you can do:

INSERT INTO 
  (column1, column2, etc...)
SELECT (column1, column2, etc...) 
  FROM  
  WHERE...etc.

-joe


On Mon, 13 Dec 2004 12:36:51 -0600, Nick Baker <[EMAIL PROTECTED]> wrote:
> What is the most efficient way to copy or transfer selected records from
> one table to another table with the same structure?. I.e., all records
> within a certain date range.
> 
> Select and Insert seems be a very laborious method.
> 
> Thanks,
> 
> Nick
> 
> 

~|
Special thanks to the CF Community Suite Silver Sponsor - CFDynamics
http://www.cfdynamics.com

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187417
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Copy Or Transfer Selected Records From One Table To Another Table?

2004-12-13 Thread Dave Carabetta
On Mon, 13 Dec 2004 12:36:51 -0600, Nick Baker <[EMAIL PROTECTED]> wrote:
> What is the most efficient way to copy or transfer selected records from
> one table to another table with the same structure?. I.e., all records
> within a certain date range.
> 
> Select and Insert seems be a very laborious method.
> 


INSERT INTO myNewTable(
 column1,
 column2
)
SELECT column1,
 column2
FROM myOldTable
WHERE date_column >= '01/01/2004'
 AND date_column <= '02/01/2004'


(I'd use cfqueryparam for the dates, but this is for simplicity-sake.)

Regards,
Dave.

~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187414
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54


Re: Copy Or Transfer Selected Records From One Table To Another Table?

2004-12-13 Thread Greg Morphis
I'm not about other DBs
but

INSERT INTO TableA
SELECT * FROM TableB

works fine in Oracle


On Mon, 13 Dec 2004 12:36:51 -0600, Nick Baker <[EMAIL PROTECTED]> wrote:
> What is the most efficient way to copy or transfer selected records from
> one table to another table with the same structure?. I.e., all records
> within a certain date range.
> 
> Select and Insert seems be a very laborious method.
> 
> Thanks,
> 
> Nick
> 
> 

~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:187415
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54