Solved

Demonstrate joining of two mysql databases

Posted on 2014-12-21
2
293 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Read about achieving the basic levels of HRIS security in the workplace.
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…

726 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