macromedia.coldfusion.database_access
[Top] [All Lists]

Creat new table from multiple tables in same DB?

Subject: Creat new table from multiple tables in same DB?
From: "newportri" <webforumsuser@xxxxxxxxxxxxxx>
Date: Tue, 29 Jul 2008 13:42:10 +0000 (UTC)
Newsgroups: macromedia.coldfusion.database_access

Trying to create a new table bringing in all the records from 3 old tables. All 
three old tables have common foreign key fields.

 I'm not sure how the syntax would look like, but something like:

 <cfquery name="qCreateTable"  datasource="somedb">
 CREATE TABLE newtable
 AS
 SELECT  old_ID as new_ID,

 .....

 FROM oldtable1, oldtable2, oldtable3 etc.</cfquery 

 Is this possible in one step, or would I need to create the new table with 
data from oldtable1, then update with data from 2, 3 etc.?  BTW I already tried 
that with no success (syntax errors).

 For now, this is in Access.

 Thanks for your help.

 rinorman


<Prev in Thread] Current Thread [Next in Thread>