Cross table join using MYSQL, not MSSQL

Is it possible to make a cross-tab join in mysql spanning different tables? in different databases.

Does this seem easily possible in MSSQL and makes data transfers much faster?

How about mysql, you need to use a powerful IDE for this? or do you need to write a program to do something like this?

UPDATE tblUser SET tblUser.ReceiveInfo = old_database.dbo.contact.third_party_info_yn FROM tblUser inner connection old_database.dbo.contact ON old_database.dbo.contact.id = tblUser.oldid

0


source to share


3 answers


Of course, very easy. Prefix the table name with the database name as you show. We run cross-referenced databases on a regular basis. For example:

SELECT COUNT (*) FROM newusers1.users JOIN newusers2.users



This, of course, will not speed up the data transfer compared to having both tables in the same database.

Now, if your tables are sitting on different database servers, the answer is no. An example of this is if your database is too big and you need to delineate your tables. Things are getting more than dirty. But given that you seem to be happy with the MS SQL solution, this doesn't seem to apply here.

+3


source


In MySQL, you can cross-connect databases and even connect to the server using the FEDERATED mechanism.



+1


source


MySQL doesn't really care if the tables are in the same "database", it's just a logical collection of tables for easy administration, permissions, etc.

So, you can make the connection between them as easy as if they were in one (see ChrisInEdmonton's answer)

0


source







All Articles