473,322 Members | 1,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

JOIN into a new table?

Is there a way to execute a JOIN, and have the result of the JOIN populate a
new permanent table? I would like to execute a complex join and have the
results of the join, end up as records in a new permanet table.

thx
Jul 20 '05 #1
4 1783
Robert Oschler wrote:
Is there a way to execute a JOIN, and have the result of the JOIN populate a
new permanent table? I would like to execute a complex join and have the
results of the join, end up as records in a new permanet table.


Yes, you can populate a table with the results of any SQL query.
Syntax is:

INSERT INTO destinationTable (field1, field2, etc)
SELECT field1, field2, etc FROM ...

Regards,
Bill K.
Jul 20 '05 #2

"Bill Karwin" <bi**@karwin.com> wrote in message
news:cp********@enews3.newsguy.com...
Robert Oschler wrote:
Is there a way to execute a JOIN, and have the result of the JOIN populate a new permanent table? I would like to execute a complex join and have the results of the join, end up as records in a new permanet table.


Yes, you can populate a table with the results of any SQL query.
Syntax is:

INSERT INTO destinationTable (field1, field2, etc)
SELECT field1, field2, etc FROM ...

Regards,
Bill K.


Yes, but he must create the destinationTable first
Jul 20 '05 #3
Robert Oschler wrote:
Is there a way to execute a JOIN, and have the result of the JOIN populate a
new permanent table? I would like to execute a complex join and have the
results of the join, end up as records in a new permanet table.

thx

Have a look at the "CREATE TABLE ... SELECT" syntax
Jul 20 '05 #4
----- Original Message -----
From: "Rich R" <rr***@cshore.com>
Newsgroups: mailing.database.mysql
Sent: Wednesday, December 08, 2004 5:02 PM
Subject: Re: JOIN into a new table?


Yes, but he must create the destinationTable first


Not necessary if you replace "SELECT INTO" with "CREATE TABLE".

You can prefix any SELECT query with a CREATE TABLE {xxx} and a new physical
table {xxx} will be created for you.

And, of course -

The SELECT query can contain any kind of JOIN you please.

-Tom
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Marek Lewczuk | last post by:
Hello, I have a strange problem, maybe some of you will be able to explain me something. I use LEFT JOIN as a substitute for subselects. It's true that many subselects can be rewriten using LEFT...
0
by: B. Fongo | last post by:
I learned MySQL last year without putting it into action; that is why I face trouble in formulating my queries. Were it a test, then you would have passed it, because your queries did help me...
4
by: eXavier | last post by:
Hello, I have query joining several tables, the last table is joined with LEFT JOIN. The last table has more then million rows and execution plan shows table scan on it. I have indexed columns...
4
by: thilbert | last post by:
All, I have a perplexing problem that I hope someone can help me with. I have the following table struct: Permission ----------------- PermissionId Permission
3
by: Dam | last post by:
Using SqlServer : Query 1 : SELECT def.lID as IdDefinition, TDC_AUneValeur.VALEURDERETOUR as ValeurDeRetour FROM serveur.Data_tblDEFINITIONTABLEDECODES def,...
8
by: xixi | last post by:
when i create a join view like this create view JV104FZ.APJTINM1 (APAM32, APNO20, APQY05, PONO01, PONO05, PONO19, POCD01, POCD13, systimestamp, loginname, id ) as select JV104FZ.APPTINM.APAM32,...
3
by: Martin | last post by:
Hello everybody, I have the following question. As a join clause on Oracle we use " table1.field1 = table2.field1 (+) " On SQL Server we use " table1.field1 *= table2.field1 " Does DB2...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
4
by: Jane T | last post by:
I appreciate how difficult it is to resolve a problem without all the information but maybe someone has come across a similar problem. I have an 'extract' table which has 1853 rows when I ask for...
4
by: polycom | last post by:
Assistance needed to optimize this query SELECT SD.content_id AS Id, SD.title AS Title, CT.name AS Contenttype, PV.content_id AS SponsorId, ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.