Solved

Demonstrate joining of two mysql databases

Posted on 2014-12-21
2
281 Views
Last Modified: 2015-01-05
I have mysql and want to write some syntax demonstrating the joining of two databases into a single table.  Assistance is greatly appreciated.
0
Comment
Question by:frugalmule
  • 2
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 40512115
INSERT INTO db1.newtable 
SELECT * FROM db1.tablename
JOIN db2.tablename ON db1.id = db2.id

Open in new window


This assumes all column names follow the same order as the new table else you would have to specify them in the select statement.
0
 
LVL 58

Expert Comment

by:Gary
ID: 40512116
And rereading again maybe I'm misunderstanding
joining of two databases into a single table
What exactly do you mean?
Is this two tables with the same data but in two db's and you just want to move all the rows to one table?
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SQL Command Tool comes with APEX under SQL Workshop. It helps us to make changes on the database directly using a graphical user interface. This helps us writing any SQL/ PLSQL queries and execute it on the database and we can create any database ob…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question