Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 19th, 2007, 02:49 AM
Registered User
Join Date: Apr 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to asadullah Send a message via Yahoo to asadullah
Default MySQL Connect DataBases!!!

I am a MySQL beginner. How can I connect two tables of two different databases, such that I can access one table of a database from the table of other database and all the operations can be performed on these tables, like insert update delete.

GAUHER Is Always Light
Old April 26th, 2007, 12:54 AM
Authorized User
Join Date: Oct 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts

Hi asadullah,

To operate whith two tables from different databases, one have to use 'join' operation. There are several types of this operations.

simple sql statement below:

select * from db_1.tb_1 JOIN db_2.tb_2 where db_1.tb_1.col_1 = db_2.tb_2.col_2

note that column names must be similar here. For example, if your column name in first table is user_id, then column name in second table should be user_id too.

The result of this operation: table with all the columns existing both in first table and in second table.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Code for Beginning databases with MYSQL sponsora MySQL 3 July 18th, 2008 06:24 AM
How to connect Access to diff databases catkins Access VBA 4 April 24th, 2004 12:53 PM
beginning databases with mysql Dai All Other Wrox Books 0 November 6th, 2003 09:29 AM
exporting mysql databases Endee PHP Databases 2 August 1st, 2003 02:15 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.