Question
Creat new table from multiple tables in same DB?
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
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
