Solved

Demonstrate joining of two mysql databases

Posted on 2014-12-21
2
261 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
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now